Network & Data Centers Operational (99.98% Uptime) 100% Green Power
Web hosting (DirectAdmin)

Protecting a folder with a password

Make part of your website, such as a test site, accessible only with a username and password.

Updated on 5 November 2026

Want only certain people to see part of your website, for example a test version or a folder with documents? Protect the folder with a password. The browser then asks for a username and password before the page opens.

Protecting a folder

  1. Go to Advanced Features → Password Protected Directories.
  2. Click Add Protected Directory next to the domain.
  3. Under Path, choose the folder, for example domains/test.voorbeeld.nl/public_html for a subdomain with a test site.
  4. Under Directory realm, enter a short text that visitors see in the login box, for example Test site.
  5. Click Protect.
  6. Then add one or more users, each with their own username and password.

Protected directories in DirectAdmin

The protection also applies to every folder below it.

Good to know

  • These users are separate from your DirectAdmin account and from email addresses. Give them their own strong password.
  • Do not protect WordPress's wp-admin folder this way without testing: some plugins need access to wp-admin/admin-ajax.php.
  • Always use https. Without https, the username and password travel over the internet unencrypted.
  • Search engines cannot enter a protected folder, which makes this a good way to keep a test site out of Google.

More about Web hosting (DirectAdmin)

Still stuck? Create a ticket in the customer panel or call us on 0475 227 400. We are happy to help. Create a ticket →