Password Protecting Directories
- In cPanel, under "Files", select the "Directory Privacy" icon.
- Select "Web Root". You might need to checkmark "Show Hidden Files"
- Click the directory that you wish to password protect.
- Check the "Password Protect This Directory" box.
- Enter the name of the directory you wish to display to visitors trying to log in.
- Select "Save".
- Select "Go Back"
- 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.
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.