background preloader

Apache

Facebook Twitter

Dynamic Drive: .htaccess password generator. Online Tools: .htaccess Password Generator Use this tool to generate all the necessary codes needed to password protect a directory or selects files within it on your site via .htaccess.

Dynamic Drive: .htaccess password generator

It encrypts the desired passwords, then outputs the corresponding codes to put inside your .htaccess and .htpasswd files. Example: Click here. (Username: user Password: test) Frequently Asked Questions Q: For 2) above, what should I enter as the path? Q: For 2) above, how can I find out my server path? Q: For 3) above, what should I enter, if anything? Q: I've uploaded my .htaccess and .htpasswd files to the correct locations, but when I try and enter my username/password to enter the protected area, it still wouldn't let me in! AuthUserFile /home/mysite/.htpasswd As mentioned, in Linux you can type "pwd" in telnet/SSH to find out your server's root directory (ie: /home/mysite).

Q: How come after I've uploaded my .htaccess file via FTP, I can no longer see it in FTP? Mod_rewrite: Extending Rules with RewriteCond. You should be happy with the RewriteRule command, and if not please go back to part one.

mod_rewrite: Extending Rules with RewriteCond

What about rewriting depending on referrer, query string, IP address, whether or not the file exists? We can do this and more by extending our rules using the RewriteCond directive. RewriteCond STRING CONDITION STRING must be a server variable or a backreference from previous a RewriteCond. Backreferences work as described in mod_rewrite part one - except a backreference from a RewriteCond takes the form %N whereas it is $1 if from a RewriteRule. CONDITION can be another regular expression, similar to a RewriteRule. How does this fit into our RewriteRule? How to host the Primary Domain from a subfolder (.htaccess)

Summary Your main domain will use the public_html directory for all of its Web site files by default.

How to host the Primary Domain from a subfolder (.htaccess)

Addon domains use sub directories inside the public_html directory. In order to also set up your main domain to use a subdirectory on your hosting account you will need to set up a redirect in the .htaccess file in the public_html folder so that the server knows that any request for your main domain will be redirected to a subdirectory on public_html. Joomla, Drupal and WordPress If you are using Joomla, Drupal or WordPress it is recommend that you not follow these instructions, rather that you follow the instructions provided by in the official documentation.

URL Rewriting for Beginners. Introduction URL rewriting can be one of the best and quickest ways to improve the usability and search friendliness of your site. It can also be the source of near-unending misery and suffering. Definitely worth playing carefully with it - lots of testing is recommended. With great power comes great responsibility, and all that.

There are several other guides on the web already, that may suit your needs better than this one. Apache URL Rewriting Guide - The best guide around Before reading on, you may find it helpful to have the mod_rewrite cheat sheet and/or the regular expressions cheat sheet handy. What is "URL Rewriting"? Most dynamic sites include variables in their URLs that tell the site what information to show the user. The problems with this kind of URL structure are that the URL is not at all memorable. Clearly a much cleaner and shorter URL. Now we're getting somewhere. Unfortunately, the last URL cannot be easily understood by a server without some work on our part. Number} The Ultimate Guide to .htaccess Files. Apache's .htaccess configuration files have baffled countless developers.

The Ultimate Guide to .htaccess Files

This tutorial aims to break through this confusion by focusing on examples and thorough descriptions. Among the benefits of learning .htaccess configuration is automatic gzipping of your content, providing friendlier URLs, preventing hotlinking, improving caching, and more. Password Protect a Directory with .htaccess. A tutorial explaining how to retrict access to a directory on a web server using .htaccess.

Password Protect a Directory with .htaccess

Password protecting a directory can be done several ways. Many people use PHP or ASP to verify users, but if you want to protect a directory of files or images (for example), that often isn't practical. Fortunately, Apache has a built-in method for protecting directories from prying eyes, using the .htaccess file. In order to protect your chosen directory, you will first need to create an .htaccess file. This is the file that the server will check before allowing access to anything in the same directory. You'll need first to define a few parameters for the .htaccess file. AuthUserFile /full/path/to/.htpasswd AuthName "Please Log In" AuthType Basic You've now defined a few basic parameters for Apache to manage the authorisation process. The AuthName parameter basically just defines the title of the password entry box when the user logs in.

Require valid-user require user dave dave:XO5UAT7ceqPvc.