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
- Log in to DirectAdmin.
- Go to Advanced Features and click Password Protected Directories.
- Choose your domain and click Add Protected Directory.
- Select the folder you want to protect.
- Enter a name for the protected area in Directory realm, such as "Staging site". Visitors see this name when asked to log in.
- Click Protect.
- 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.