You can make the browser ask for a username and password before showing a folder, or your whole site. It's handy for a site you're still building, a staging copy, or files only a few people should see.
Protect a folder
- Open DirectAdmin from your service page (one-click login).
- Go to Advanced Features → Password Protected Directories.
- Choose the folder. To protect the whole site, choose
public_htmlfor your domain. - Turn protection on, enter a name for the prompt (like "Private"), and add a username and password. Then Save.
Open the address in a private browser window to check: the browser should ask for the username and password.
To let more people in, add a user for each one, so you can remove a person later without changing everyone's password. To remove protection, untick it on the same page.
Good to know
- It's a simple lock. It keeps casual visitors and search engines out. Use a strong password, but don't rely on it alone for sensitive data.
- Search engines can't see protected pages. Remember to remove protection when your site goes live.
- WordPress: protecting the whole site also protects the login page and the admin area, which is a useful extra layer while you're building. Some plugins and services need to reach your site from outside (payments, uptime monitors), so they may stop working while it's protected.
- Only a few pages? WordPress can password-protect a single post or page itself: open it, and under Visibility choose Password protected.
Questions? Open a ticket.
Open a ticket and a real person will help you, any time of day.
Open a ticket Other ways to reach us