Sometimes you need to keep part of your site private — a staging area, a client’s files, an admin folder, a work-in-progress section. cPanel’s Directory Privacy puts a login prompt in front of any folder, so only people with the password can see what’s inside. Here’s how.

How it works

Directory Privacy adds server-level password protection to a folder. Anyone trying to access it — or any file within it — is met with a browser login box and can’t proceed without the right username and password. It’s separate from any login your website itself might have, and it works before your site’s code even runs, which makes it a solid layer of protection.

Protecting a folder

  1. In cPanel, open Directory Privacy under the Files section.
  2. Browse to the folder you want to protect and click its name.
  3. Tick Password protect this directory, give it a display name, and save.
  4. Now create a user: enter a username and password under Create User, and save.

That’s it — the folder now demands a login.

Good uses for this

  • Staging sites: keep a work-in-progress copy hidden from the public and from search engines.
  • Client deliverables: share files with a specific client behind a simple login.
  • Sensitive folders: add an extra barrier in front of an admin or upload directory.

Managing access

You can add several users to the same protected folder, each with their own login, and remove any of them when their access should end. To lift protection entirely, return to Directory Privacy, open the folder, and untick the protection option.

A note on what it protects

Directory Privacy guards the folder at the web-server level, which is exactly what you want for hiding content from casual visitors and search engines. Bear in mind it protects access to files, not the files’ contents if someone already has them. For truly sensitive data, combine it with other measures — but for keeping a section of your site private, it’s ideal.

Pairing it with a staging site

A common setup is a staging subdomain protected by Directory Privacy, so you can test changes on a live-like copy without the world (or Google) seeing it. Add the protection, share the login with your team, and test freely.

It’s a simple, effective tool. If you’d like help setting up a protected staging area or client folder, just let us know.

Was this article helpful to you?

admin

Leave a Reply

You must be logged in to post a comment.