Posted on November 22nd, 2006
8696 views Password Protect A Directory The server your site is on needs to have Apache. Or else it will not work...
AuthUserFile .htpasswd
AuthName "Directory name"
AuthType Basic require valid-user You do not need to edit this, you just leave as. This tells the server that to enter the directory, you need to be a valid user. Here is the full code: AuthUserFile .htpasswd AuthName "Directory Namel" AuthType Basic require valid-user Save that as .htaccess and place it in the directory you want to protect. Now thats no good, if we havnt got any usernames & passwords... So for this, we need to use a generator to generate the encrypted password. You can find the generator here So enter the username and password you want, it will give you the code. Place the output in a blank file and save it as .htpasswd Now upload both files to your directory, and test it. If you followed the tutorial correct, it should work! You will find both files in the ZIP folder that is available for download at the end of the tutorial. The username and password for the file in the ZIP is: Username: Test Password: testing
|