Free Advertising - Mortgage Calculator - Remortgages - Homeowner Loans - Credit Card Consolidation

PDA

View Full Version : .htpasswd and .htaccess


jk111
Jan 31st 2008, 2:51 pm
Ok, so I have the .htaccess file that looks like this placed in the directory I want to password protect.
AuthName "Secure Area"
AuthType Basic
AuthUserFile /path/to/your/directory/.htpasswd
require valid-user

Now I used the .htpasswd command and got that file created but now what do I do ?

Thanks.

P.s I am using windows apache version 2.2.8

boltok
Feb 2nd 2008, 1:48 am
The htpasswd command is used to create a password file (can be any name) and add the username + password to this file.

Once you've done that and added the "require username" line in your .htaccess, that should be enough and you should get a prompt when you try to access this area from your browser.