Password protecting a directory adds a login prompt before anyone can view the files inside it. This is useful for staging areas, admin folders, private downloads, or pages you are not ready to publish.
When to Use Directory Privacy
- Protecting a staging or development folder.
- Securing an admin or internal tools area.
- Sharing private files with selected people only.
Enabling Protection
- Log in to cPanel.
- Open Directory Privacy in the Files section.
- Browse to the folder you want to protect and select it.
- Tick Password protect this directory.
- Give the protected area a name, then click Save.
Creating a User
After protecting the directory, you must add at least one user who can log in:
- On the same page, find the Create User section.
- Enter a username and a strong password.
- Click Save.
You can add more users later, each with their own login.
How Visitors Experience It
When someone visits the protected folder, the browser shows a login box. Only those with a valid username and password can proceed. The protection applies to everything inside that folder, including subfolders.
Important Notes
- Password protection works at the folder level, not for a single file.
- It uses your
.htaccessand.htpasswdfiles, which cPanel manages for you. - To remove protection, return to Directory Privacy and untick the protection option.
If the login prompt does not appear, confirm you selected the correct folder and that at least one user exists. For help, contact support on WhatsApp at +254 796 358081.