Password Protect Directories Icon
Posted by , Last modified by Aaron Eaton on 21 April 2016 03:03 PM
You can password protect directories (folders) via cPanel, protecting all the files within the password protected folders.
Note: At this time, cPanel can only protect directories, not individual files. Any file that needs protection can be placed in a protected directory.
To password protect a directory:
To ensure your directory has been password protected, launch your browser and view the directory. If the browser prompts you to login, then your folder has been password protected.
Warning! This password has a maximum of 8 characters. Any characters typed beyond the first 8 will not be required by visitors.
404 Error When Using a URL with a Shared Server SSL
If you are accessing a password protected directory with a URL that includes the use of a shared server SSL (https://securexxx.rfehosting.com/~<user>/<whatever>) and receiving a
To resolve this, add a single line to the .htaccess file in the protected directory, to give Apache the 401 page it is looking for (ErrorDocument 401 "Authorization Required").
In the following code, please be sure to replace yourusername with your actual cPanel username, and also be sure the gator114 is replaced with your actual server number. This information can be found in your welcome email as well as on the left navigation menu in your cPanel.
ErrorDocument 401 "Authorization Required"
500 Error After Login
Check the folder ownership on the .htpasswds folder (above public_html). Change them from user.user to user.nobody and ensure the permissions are set to 750 and then refresh your protected page. The error will be gone.