How to Password Protect sections of your website
Anybody can access the content within the folder public_html (folder containing all public files of your hosting account) with a web browser. To limit or control access to particular directories within the public_html directory:
- Connect to cPanel
- Click on Directory Privacy in the Files section. It will list the folders in your account.
- Click on the icon to the left of a folder to see its content.
- Click on the folder name (as opposed to its icon) to modify its security settings.
- In Security Settings, check the Password protect this directory box.
- Enter a name for the protected directory (for example 'My protected folder')
- Click Save.
- At the bottom of the page, create a username and password to permit access to the protected folder.
- Click Add/modify authorized user. You can add as many authorized users as you like.
- You're all done! Check if the selected directory is correctly secured with the new settings by connecting to it with your web browser. For example, if you've password-protected the folder "public_html/test" on yourdomain.com, the following address will prompt you to enter a password: yourdomain.com/test
Note: You cannot password-protect individual files, only folders.
Article ID: #HC5047