Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Password Protect Directories

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

  1. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    98
    Likes Received:
    3
    Trophy Points:
    58
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,352
    Likes Received:
    404
    Trophy Points:
    583
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    98
    Likes Received:
    3
    Trophy Points:
    58
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #3 k2tec, Nov 4, 2011
    Last edited: Nov 4, 2011
  4. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    98
    Likes Received:
    3
    Trophy Points:
    58
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. k2tec

    k2tec Well-Known Member

    Joined:
    Aug 26, 2011
    Messages:
    98
    Likes Received:
    3
    Trophy Points:
    58
    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"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice