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 Protected Directory

Discussion in 'Security' started by chrisinoz, Aug 5, 2012.

  1. chrisinoz

    chrisinoz Member

    Joined:
    Aug 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I have managed fine using this facility but this time my client wants me to protect an directory that index page is secure that is https://. (ssl is installed on the site)

    I find it works fine for http.

    Possible for https?

    Chris
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Chris,

    When I select to password protect public_html, it is causing a login prompt for both http and https on the domain.

    If it isn't working for both http and https to prompt for the login for the username and password, there is likely a conflicting rule in .htaccess in the public_html folder.

    Thanks!
     
  3. chrisinoz

    chrisinoz Member

    Joined:
    Aug 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks for quick reply - I just checked and there is no public_html .htaccess file. Do you know what would be a suitable content for it?

    Cheers
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    I don't understand how you would have password protect directories working for the main public_html folder if you don't have an .htaccess file there. Are you sure you are looking at hidden files in your FTP client or File Manager? I believe the file has to be there if http is working for password protect directories, since that file is required to exist with content to password protect in order to work at all.

    If you are using File Manager, please select in cPanel main screen at the bottom "reset all interface settings" option and then go back into File Manager by re-clicking on the icon. Ensure that you are looking at hidden files by clicking "Show Hidden Files (dotfiles)." on the popup for File Manager.

    Thanks!
     
  5. chrisinoz

    chrisinoz Member

    Joined:
    Aug 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks I see that now.

    I am actually trying to work with a folder = client and my .htaccess file in there is (generated by cpanel)

    AuthUserFile "/home/baristat/.htpasswds/public_html/client/passwd"
    AuthType Basic
    AuthName "clientlogin"
    require valid-user

    The actual public_html .htaccess file is blank.

    Cheers
    Chris
     
  6. chrisinoz

    chrisinoz Member

    Joined:
    Aug 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks for you help - got things sorted.

    Cheers
     
Loading...

Share This Page