Docs Home Return to Homepage
Get Started Login

How to Password Protect a Folder on Your Website in DirectAdmin

Last updated Changelog

On this page

Password Protected Directories puts a password on a folder of your website. Anyone who opens a page in that folder sees a login box and needs a username and password to get in. It’s a quick way to hide a staging site, a members area or files for one client. In this example we’ll protect yourdomain.com/members.

Steps

  1. Log in to DirectAdmin. In the Advanced Features section, click Password Protected Directories.

    The DirectAdmin Advanced Features section with Password Protected Directories highlighted

  2. Click Add Protected Directory next to your domain.

    The Protected Directories page with Add Protected Directory highlighted for directadmin.cranedemo.com

  3. Under Path, click your website folder (domains/yourdomain.com/public_html) to open it, then pick the folder to protect, such as members. Type a Directory realm: visitors see this name in the login box. Click Protect.

    The members folder selected, the realm “Members area” and Protect highlighted

  4. Under Manage users, type a Username and Password (or click the dice icon to generate one), then click Add User.

    The Username member, a password and Add User highlighted

  5. The user is listed. Add more users the same way if more than one person needs to get in.

    The user member listed with Delete and Change password

In our test, https://directadmin.cranedemo.com/members/ showed a login box straight away and only opened with the right username and password.

Note: The username and password are only for this folder. They’re not an email or DirectAdmin login, so you can give them out without sharing anything else.

Troubleshooting

Problem What to do
I want to change a user’s password Open the protected folder from Password Protected Directories and click Change password next to the user.
I want to remove someone’s access Click Delete next to their username.
I want to remove the password completely On the Password Protected Directories page, click Remove Protection next to the folder.
The login box keeps coming back Check you’re typing the username exactly as you created it. Passwords are case-sensitive.

Snagged on something? Contact support and we’ll get you sorted.

Snagged on something?

Our sysadmins answer tickets around the clock.