How to password-protect a folder

Directory Privacy puts a username and password in front of a folder on your site — or the whole site — handy for staging areas, client previews and private files.

The Directory Privacy page in CHPanel

Protect a directory

  1. Sign in at chpanel.bphost.biz with your hosting account email address and CHPanel password, then open Files → Directory Privacy.
  2. Under Protect a directory, choose the Site.
  3. Type the Directory to protect, e.g. private or staging. Leave it blank to protect the whole site — ideal while you are still building it.
  4. Give it a Prompt label such as "Restricted Area"; browsers show this on the login box.
  5. Add one or more Users — a name and a password for each person who may enter.
  6. Click Protect directory.

How it works

Anyone opening that folder now gets a browser login prompt and must enter one of the usernames and passwords you set. Everything inside the folder, including subfolders, is covered. Come back to Directory Privacy at any time to manage the folders you have protected.

Tip

This is a simple lock for a whole area, not a login system for your app — WordPress and other apps keep their own user logins. Want to protect a folder that does not appear, or remove a protection you cannot find? Open a support ticket.

Was this answer helpful?

 Print this Article

Also Read

How to upload your website

Once your hosting is active, put your website online by uploading its files to the public_html...

How to set up an FTP account

FTP lets you upload and manage your website files with a program like FileZilla or Cyberduck....

How to change your PHP version

Different apps need different PHP versions. In CHPanel you choose the PHP version per website,...

How to set up a redirect

Redirects send visitors from one address to another — useful when you move a page, rename it, or...

How to create a custom 404 error page

A friendly page not found (404) page keeps visitors on your site instead of hitting a blank...