1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Article

Adding password protection to a directory using the .htaccess editor

Password protecting a directory

Protecting a directory involves two steps: enabling protection and designating the users authorized to access the protected directory.

The Password Protection tool allows you to password encrypt certain directories on your website. You can allow individual users access to these encrypted pages by giving them their own username and password.
 

Note: Password protection applies to the directory level and cannot be used to protect individual files. If you wish to protect only one file, place that file in its own directory.


Enable Password Protection for a directory

  1. Log in to your account Hosting Summary
    Click for the Hosting Summary
  2. On the left sidebar, click on .htaccess Editor. 
    left sidebar, .htaccess Editor
  3. From the .htaccess Editor page, click on the Manage Password Protection link.
    Manage Password Protection
  4. The current protection setting for the selected directory displays in the Password Protection Status section. 
    Password Protection Status
  5. To change the setting, click one of the following slider buttons:
    • Enable to add protection
    • Disable to remove existing protection
  6. Enter the Authorization Realm area for the directory. This is a tag name used for the protected directory.
    Authorization Realm Name
  7. Add users who will be granted access to the protected directory.
    • Click the plus sign to Add User
    • In the Manage Users section, enter a username, and then enter the password
    • Click Save User
      plus icon
      Manage user
  8. Follow step 7 to add any other users.
  9. To change the password for a user:
    • Click the pen icon on the far right side of the user
    • Enter the new password
    • Click Save User
      change password, pen icon
  10. To remove a user, click the x mark symbol on the far right side of the user.
    remove user, x mark symbol

Once the Password Protection is enabled, the site visitor will be prompted to enter the username and password to sign in.  

username and password

Important: All subdirectories of the selected directory will inherit its settings unless you apply different settings to specific subdirectories.
Chat
Close