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 Directories

Discussion in 'Security' started by k2tec, Nov 3, 2011.

  1. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    I tried to protect my admin dir. But when I setup the protection by Cpanel Password protect this directory: admin V ----> Name the protected directory: admin ----> save

    Set my user name and password and added the user. No problem, but when I go to http://xxx.com/admin/ it's say nothing found and goes to my home page. No login screen for username and password.

    It maded the file in /.htpasswds/public_html/admin with username and secret password and it also made the .htaccess in the admin file.

    Is there somebody with a answer to this question.

    Sorry for my bad English.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might go back to the Password Protect Directories page in cPanel and just double check that you checked the box to:
    Password protect this directory:

    I'm not sure why it would forward you to your homepage though. Is there anything else in the .htaccess file that might do this?
     
  3. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Well it is strang, because I have other domains that are working. The .htaccess in the public_html are the same.
    And on the other domains I get the login screen.
    And I have tried it 3 times. But I will give it a other try this evening.

    Well I tried it again, but no luck. It returns me to the home page with a 401
     
    #3 k2tec, Nov 4, 2011
    Last edited: Nov 4, 2011
  4. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Okay I think it having some problem with the .htaccess in my public_htmlbecause when I make it as text it works but I can't find what,
    This is My htaccess
     
  5. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    81
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Okay for everybody you is running into the same error.

    Place in your htaccess which is in the public_html at the first line.

    ErrorDocument 401 "Unauthorized"
     
Loading...

Share This Page