Password Protected Directories
There may be times that you want to prevent access to a web page or section of pages. This can be done by password protecting the directory that contains the page(s).
You can let one or several users access a protected directory. A typical use would be a web page that contains content for subscribers or information that you want only select people to access. You would create a sub folder inside your public_html folder using your ftp program or the file manager and upload the page into that directory and then assign it a login and password so only the people you supply the login and password would have access to the web page(s) within that directory.
For example, you have a pdf document located atpublic_html/newsletters/july/special_report.pdf . By password protecting the "newsletter" directory, it will require anyone going to the addresshttps://www.yoursite.com/newsletters/july/special_report.pdf to enter a login and password before being granted access.
Select the Password Protect Directories icon from your cPanel main page. A list of the directories on your account will appear.
Navigate the directory list
The current directory is always displayed at the top of the list.
Password protect a directory
Please note that you have to create a directory before you enable the password protection for it. Also, using one and the same directory for the purpose of password protection and FTP storage in the same time is not recommended.
CAUTION: Do not password protect your webroot (the www directory) or your website will not be displayed directly.