+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Security

How to Password-Protect a Directory on Your Website

Password-protecting a directory puts a login prompt in front of a specific folder on your website, so only people with the username and password you set can view anything inside it. This is useful for a staging area you are not ready to make public, an internal document folder, or a client-only download page. It works at the server level, separate from any login system your website's software might have.

In cPanel

  1. Log in to cPanel and open Directory Privacy under the Files section.
  2. Browse to the folder you want to protect and click its name.
  3. Check Password protect this directory, give it a label, and click Save.
  4. Scroll down to Create User, enter a username and password for anyone who should be able to access the folder, and click Save.
  5. Repeat the user step for each person who needs access. You can add more than one username to the same protected folder.

In DirectAdmin

  1. Log in to DirectAdmin and open Password Protected Directories under Advanced Features.
  2. Browse to and select the folder you want to protect.
  3. Turn on Enable Password Protection and enter a name for the protected area.
  4. Under the user section, enter a username and password, then click Create.
  5. Add additional usernames the same way if more than one person needs access.

What visitors see

Anyone who tries to open the protected folder or a page inside it will see a browser login prompt asking for a username and password before the page loads. There is no way to customize this prompt's appearance, since it comes from the web server rather than your website's design.

Directory protection covers the folder path itself. If your site links to files inside that folder from elsewhere, visitors clicking those links will still be asked to log in, so this is a reliable way to keep unfinished or private content out of search results and casual browsing.

To remove protection later, return to the same tool, select the folder, and uncheck or disable the password protection option.

Security