Forum Moderators: bakedjake
I am using a linux server, and I password protect a directory by using two files located in that directory:
.htaccess
.htpasswd
The directory currently is password protected, but when being prompted for my password, I am prompted twice.
I am prompted twice on different computers, operating systems and browsers.
Any ideas? Being prompted twice can be annoying.
Here's what my files look like:
.htaccess:
AuthUserFile /folder_path/folder_name/.htpasswd
AuthName "Login Required"
AuthType Basic
require valid-user
.htpasswd:
user1:coded_password1
user2:coded_password2
user3:coded_password3
user4:coded_password4
- Is the directory protected by another mechanism?
- Is there any redirect after you enter the first password (see apache.org [httpd.apache.org])?
If i request a directory without the / i get prompted twice too, no matter what. Although it might be the settings, i use a pretty strict IE6. If i enter the login, and make it remember, it will record the info for the dir and dir/ separately too...
... on another note, ( and another site ) there's a separate .htaccess in the domain root doing redirects and ever since it's in place ( from /default.html to / ) the server would request the password for dir and dir/ all the same, except... it would show a 404 for the first request. ( i'm pretty lame with .htaccess )
Sorry, it took a while to reply but I was trying to learn the absolute path of the level above my public html so I could move my files there.
Once I moved the passwords file up to that level as suggested it seems to work fine now, but I need to do some more testing.
Thanks everyone for all your help!