GICT knowledge base
Password-Protect a Website Directory in cPanel
Published
cPanel Directory Privacy adds a separate web-server login to a selected directory. It can protect a staging area or restricted download over HTTPS, but it is not a replacement for application permissions or private storage outside the public document root.
Enable protection and create an authorized user
- Sign in to the trusted cPanel account and open Files > Directory Privacy. The host must make this feature available.
- Locate the exact directory and open its Edit/security settings. Navigation controls differ between cPanel themes; confirm the complete path rather than relying on an old folder-icon screenshot.
- Select Password protect this directory, enter a descriptive label and save. The label does not rename the actual folder.
- Return to the directory’s configuration and create a separate authorized username and long unique password. Enabling the checkbox alone does not create a user.
Verify the actual protected resources
Use a fresh private browser session to request both the directory and a known file inside it over HTTPS. Confirm an unauthenticated request is challenged, an authorized user succeeds, and child directories have the intended inherited protection. Inspect actual response status if an application error page obscures the result; a browser prompt alone is not complete verification.
Directory Privacy governs website requests, not local filesystem, FTP, SFTP or Web Disk access. A reverse proxy, alternate hostname, application route or another web server may expose a different path. Test those applicable routes instead of claiming all access is secured.
If rewrites or error pages interfere
Back up the relevant configuration and investigate authentication, routing and custom 401 error handling together. The old blanket RewriteEngine Off advice is withdrawn: it can break application routing and does not diagnose every authentication problem. Ask the host to review the affected directory’s rules rather than replacing the site’s entire .htaccess file.
Remove access deliberately
To revoke one user, remove that authorized user. To remove the directory’s web password gate, deselect its protection setting and save. Other access controls can still apply; removing this gate does not necessarily make every file public. Review the public response before exposing previously private material.
Reference: cPanel Directory Privacy.
Reviewed October 15, 2026. Documentation review; no directory protection, credential or customer server rule was changed.
Related guides
Host Additional Domains on an Eligible InterServer Account
Check your hosting limits, choose a separate site or alias and use cPanel or DirectAdmin with deliberate DNS, content and certificate verification.
cPanelHardening Your cPanel Server: Beyond the Basics After CVE-2026-41940
Security is a moving target. With the recent discovery of CVE-2026-41940, it has become clear that just having a firewall isn't enough anymore.
cPanelcPanel and Plesk notice: Awstats,. Webalizer and Analog stats are being removed
Important Update: cPanel and Plesk Phasing Out Legacy Statistics Tools If you regularly check your website traffic through your hosting control panel, we have an...
cPanelThe dangers of shared licenses (in other words unofficial/cracked licenses)
Why Cracked cPanel Licenses Aren’t Worth the Risk: A Guide for InterServer Customers When you’re managing a server, every dollar counts.
