Cart
Name.comSupportArticlesAdding password protection to directories

Adding password protection to directories

Last Updated: December 25, 2025

Occasionally, you may want to host information on your website that is only accessible to authorized users. To do this, you can add password protection to specific folders or directories. Once enabled, any visitor attempting to access that part of your site will see a pop-up requesting a username and password. The content will not load until the correct credentials are provided.

How to enable password protection

  1. Log into cPanel.
  2. Navigate to the Files section and click File Manager.
  3. Locate the folder you wish to secure. Right-click the folder and select Password Protect (this will open the Directory Privacy menu).
  4. In the Security Settings section, check the box labeled Password protect this directory.
  5. Enter a display name for the protected directory; this is the label visitors will see in the login pop-up.
  6. Click Save.

How to create authorized users

After you have enabled protection, you must authorize specific users to access the folder.

  1. On the same Directory Privacy page, scroll down to the Create User section.
  2. Input a username and password.
    • Note: We recommend using the Password Generator to ensure a high level of security.
  3. Click Save or Add/Modify authorized user.
  4. You can repeat this process to add multiple users with unique credentials.

 

Important tips for success

  • Verify the protection: Open your website in a Private or Incognito browser window to test the password. Browsers often cache login credentials, which can make it appear as though the protection isn't working.
  • Subdirectories: When you password protect a folder, all subfolders inside of it are also automatically protected with the same credentials.
  • Configuration files: Enabling this feature creates or modifies an .htaccess file within the directory. Do not delete this file, or the password protection will be removed.

Chat with an expert

Live agent: 24/7

Open a support ticket

Anytime, 24-7

Get your business online and on point

Do it all right here with tools that make every step simple.