Password Protecting Directories Print

  • 23

Password Protecting Directories

  1. In cPanel, under "Files", select the "Directory Privacy" icon.
  2. Select "Web Root". You might need to checkmark "Show Hidden Files"
  3. Click the directory that you wish to password protect.
  4. Check the "Password Protect This Directory" box.
  5. Enter the name of the directory you wish to display to visitors trying to log in.
  6. Select "Save".
  7. Select "Go Back"
  8. Enter the username and password (the password cannot exceed 8 characters) and click "Save."



Verify that the directory is protected by navigating these with your browser.



Common Errors

404 Error

This can be caused by using a URL that includes the use of a shared server SSL. You are receiving a 404 because Apache is unable to find the 401 it is looking for. You will need to add this line to your .htaccess file: "ErrorDocument 401 "Authorization Required".

500 Error After Logging In

Verify the ownership of the .htapasswds folder. They must be changed from "user.user" to "user.nobody". The permissions must be set to 750.

Was this answer helpful?

« Back