The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Password protect web page folder

Discussion in 'General Discussion' started by jdc2000, May 8, 2006.

  1. jdc2000

    jdc2000 Registered

    Joined:
    May 8, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    /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?
     
  3. jdc2000

    jdc2000 Registered

    Joined:
    May 8, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Idaho Falls, Idaho, USA
    I tried setting it up again, and it is now working. Thanks for the suggestions.
     
Loading...

Share This Page