Some parts of your website should not be open to everyone. A staging copy you are testing, a members area, or a folder of private documents all need a gate. The Directory Privacy tool, also called Password Protected Directories, puts a password prompt in front of any folder you choose.
Visitors who try to open that folder see a login box. Without the right username and password, they cannot go further.
Open Directory Privacy
- Log in to cPanel.
- In the Security group, click Directory Privacy.

Choose the Folder
- Open the folder tree on the page.
- Click the folder you want to protect, such as a staging folder inside public_html.
- Tick the option to password-protect this directory.

Give the protected folder a clear name in the setup screen, so visitors and you both know what it is for. This name appears in the login prompt.
Set the Login
- Type a name for the protected area.
- Click Save.
- When the page reloads, the login details for this folder are set up automatically or through a separate user step, depending on your screen.
Create a strong password, and use a different one from your cPanel login. Share it only with people who need access.
Test the Gate
Open the protected folder in a private browser window. You should see the login prompt before any content loads. Enter the wrong details once, then the right ones, to confirm both work.
Remove Protection
When the folder no longer needs a gate, return to Directory Privacy, untick the folder, and save. Removing the protection does not delete the folder or its files.
Keeping staging sites and private folders on a secure setup takes planning. HoganHost’s cPanel shared hosting gives you the tools to set this up for each project on one account.



