Hi I am trying to password protect a directory with .htaccess. I have created a .htpasswd file and stored it at the root of the server. I have created a .htaccess file in the directory I want to protect with the following lines:
AuthUserFile /home/baltzers/domains/baltzersciencepublishers.com/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "restricted area"
require user test
But when I fill in my username and (encrypted) password, it keeps throwing back up the authentication dialog. What am I missing?
You mught want to replace the line
require user test
with:Otherwise, the user must be named "test" and exist in the
.htpasswd
file.You need to use the unencrypted password when logging in. Note that unless you're doing the whole chain encrypted (i.e. you're using
https
instead ofhttp
) then the username and password will be sent in the clear.Try this: http://tools.dynamicdrive.com/password/
The tool will create the files you need based on your form input.