Password-protecting a directory
You can require a username and password before anyone can view a folder on your site - useful for a staging area, admin tools or private downloads. In the DirhamHost panel:
- Open Directory Privacy (or Password Protect Directories).
- Browse to the folder you want to protect and select it.
- Tick Password protect this directory and give it a display name.
- Add an authorised user with a username and strong password, then save.
Visitors to that folder will now see a browser login prompt. This is implemented with .htaccess and .htpasswd files, so it works for any content, not just one application.
Tips:
- You can add several users if a small team needs access.
- Do not password-protect your main WordPress folder - it will interfere with the site. Protect
wp-adminonly with care, and add an exception foradmin-ajax.php. - Combine this with SSL so the password is not sent in plain text.
If you forget a password, simply add a new user or reset it in the same screen. Need to protect a whole staging site? We can help you set it up - WhatsApp +971 58 553 6767.
Still need a hand? Our UAE-based team is here 24/7.