question about "password protect directories"

ljwhite

Well-Known Member
Jun 20, 2005
363
0
166
There is one function called "password protect directories" in cpanel. I wonder if i can use this function to set double/multi username/password for one folder. I.e, i want to use password to protect a.com/admin. I set up two pairs of username/password. One is user1/pass1, the other is user2/pass2. Now if i want to open a.com/admin, i should input both of above username/password. First time, i should input user1/pass1, after this, i should input user2/pass2. Is this possible? If i can not do it through cpanel, could i modify the .htaccess file to do this?
 

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
This feature merely adds the relevant details to a .htaccess and .htpasswd files i.e. it is a convenient interface for Apache's standard HTTP authentication.

I don't believe that .htaccess/.htpasswd authentication can apply multiple usernames/passwords in the way you describe. You can certainly add more than one set of authentication details, however this would only mean that you could use one set or the other and not mean that you have to use both.

You might be better off checking the Apache docs to be on the safe side.