htaccess password protection
There's an easy solution in htaccess to password protect certain parts of your web site. This solution is typical for password protection for directories.Also you should upload this file, as with htaccess, in ASCII mode, not binary!
In the file you just created, you have to enter a user name and a password like this:
cstevens:applepiecstevens is the user name here and applepie is my password. If I want to enter your password protected directory, I will be prompted to enter 'applepie'.
Next, you need to tell the server which part of your site is password protected, where to find the password file and who can use it.
Open your htaccess file and add the following lines:
AuthType BasicThe path thas is shown after AuthUserFile is the path to the htpassword file and that must be correct to have this working.
AuthName "Restricted Access"
AuthUserFile /usr/local/yoursite/safedir/passwords
Require user cstevens
Require user cstevens means, that only user cstevens will have access to the password protected area. If you want more users to be able to access your private area, you will have to specify them there or replace that line by:
require valid-user
The value of AuthName can be anything you want, eg. Enter Password. It's just a name for your password protected area.
Click to return to htaccess possibilities