If you want to restrict access to specific folders on your website, cPanel provides a built-in tool called Password Protect Directories. This feature adds a login prompt when users attempt to access the protected directory, ensuring only authorized users can view its contents.
Step 1: Access the Password Protection Tool
Log into your cPanel and navigate to:
- Go to the Security section.
- Click on Directory Privacy (formerly “Password Protect Directories”).
Step 2: Select the Directory to Protect
- A list of your directories will appear.
- Click on the folder you want to password-protect.
Step 3: Enable Password Protection
- Check the box labeled Password protect this directory.
- Enter a name for the protected directory (this will appear on the login prompt).
- Click Save to apply the protection.
Step 4: Create a User and Password
- Enter a Username and Password for access.
- Click Add/Modify Authorized User.
Important Considerations
- Create the directory first: Ensure the folder exists before enabling password protection.
- Avoid using the same directory for FTP and web access: It may cause conflicts.
- Do not protect your webroot (public_html): This will block access to your entire website.
How to Remove Password Protection
- Go back to Directory Privacy in cPanel.
- Select the protected folder.
- Uncheck Password protect this directory and remove users if necessary.
Need Assistance?
If you need help setting up directory protection, UnderHost’s expert support team is available 24/7. Contact us via @CustomerPanel for professional assistance.