Knowledge Base

Password-protecting a folder

You can protect a folder on your website with a username and password, so only people with the login can see it. It's useful for staging sites, private downloads or work in progress.

Protecting a folder

  1. Log in to DirectAdmin.
  2. Go to Advanced Features and click Password Protected Directories.
  3. Choose your domain and click Add Protected Directory.
  4. Select the folder you want to protect.
  5. Enter a name for the protected area in Directory realm, such as "Staging site". Visitors see this name when asked to log in.
  6. Click Protect.
  7. Add a username and a strong password for each person who needs access.

Visit the folder's address in a private browser window to check that the login prompt appears.

Removing protection

Go back to Password Protected Directories, open the folder and remove the protection or delete individual users.

Good to know

  • Protection applies to the folder and everything inside it.
  • These logins are separate from your DirectAdmin, FTP and email logins.
  • Don't protect your whole WordPress wp-admin folder this way, as it can stop parts of your website from working. Use a security plugin or two-factor authentication for WordPress logins instead.
Please rate this article to help us improve our Knowledge Base.

0 0