HostGator.com » Support Portal

Frontpage Extensions preventing you from password protecting a directory?

The conflict is that both programs want to write your .htaccess file.

The solution is to leave your FrontPage extensions On, and then add the code needed to password protect a folder.

Here is how to code the password protect:

  1. Use FTP or File Manager to navigate inside the folder you want to protect.
  2. Edit the .htaccess file.
  3. Paste this code on a new line at the bottom. (You must replace username with your actual cPanel username.)
    AuthUserFile /home/username/.htpasswd
    AuthGroupFile /dev/null
    AuthName "A Restricted Area"
    AuthType Basic

    <Limit GET POST>
    require valid-user
    </Limit>
  4. Navigate up to above public_html (The path is /home/username/)
  5. Create a new file and name it .htpasswd, then edit the file.
  6. You need a special encrypted line here. Use an online tool (htaccesstools.com or dynamicdrive.com) to create the encrypted line.
  7. Paste the line and save the .htpasswd file.

Do NOT ever click the Password Protect Directories icon in your cPanel. If you do, it will overwrite the work you just did.


Article Comments

Ron Hinds
Perhaps it might be handy to add a note to Number 7 to indicate the file should be saved to the same place as .htaccess was.

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment