jdc2000

Registered
May 8, 2006
2
0
151
Idaho Falls, Idaho, USA
I would like to password protect a folder for some internet web pages. I used the Password Protect Directories item in cPanel, and it created the following .htaccess file:

AuthType Basic

AuthName "Protected Login"

AuthUserFile "/home/mydomain/.htpasswds/protect/passwd"


require valid-user

However, there is no "passwd" file in the folder "protect", so when I try to access the page:
http://www.mydomain.com/protect/index.htm
I enter my user name and password, but it is rejected. What am I missing? What else do I need to do to get this working? Any ideas would be appreciated. Thanks.
 

webignition

Well-Known Member
Jan 22, 2005
1,876
0
166
/home/user/.htpasswds/protect/passwd will exist but will not be viewable via FTP for normal users and under normal conditions. Trust me - I've checked a few times in the past!

You could try simply removing all users from the relevant protected directory, unprotect the directory, re-protect the directory and re-add the relevant users.

Alternatively, you could examine /home/user/.htpasswds/protect/passwd via shell and check that the contents are correct.

I'm assuming that after protecting the relevant directory you did then add the details of who can access the directory?