Directory Privacy requires a username and password before a visitor can open a selected website directory. It is useful for restricting web access to a private downloads area or a test site.

Enable directory protection

  1. Open Files > Directory Privacy in cPanel.
  2. Browse to the intended directory and click Edit.
  3. Select Password protect this directory.
  4. Enter a name for the protected area and click Save. This name labels the login prompt; it does not rename the directory.
  5. Click Go Back to return to its settings.

Create an authorised user

Under Create User, enter a username and strong password, confirm the password and click Save. Check that the user appears under Authorised Users.

Create separate credentials for people who need independently removable access.

Test protection

Open a page within the protected directory in a private browser window. Confirm that access is refused without valid credentials and succeeds with the intended user.

Subdirectories inherit the protection. This is web authentication, not a change to FTP, SSH or filesystem permissions. Check for conflicts with application rewrite rules if the prompt or website behaves unexpectedly.