How to password protect folders.

You can enable basic password protection on a folder using Helicon Ape that is installed on all of our web servers.

Create a folder in your web space that is to be secured.

Place a .htaccess file in that folder with the following content:

# Authentication type
AuthType Basic
# Name of area authentication will be used for (aka realm)
AuthName "secret area"
# Authentication provider. Here - mod_authn_file
AuthBasicProvider file
# Info for mod_authn_file - path to password file
AuthUserFile C:\Domains\yourusername\yourwebsite.com\.htpasswds
# Access will be granted to all authenticated users
Require valid-user

Note that you need to change the AuthUserFile parameter above to a valid path in the same websites webspace. It should point to a text file that you will keep the usernames and passwords in.

Create a .htpasswds file somewhere in your webspace, above the wwwroot is a good idea for security.
Use a tool to generate .htpasswds (MD5) encrypted content of your username and password access list.
Paste it into the .htpasswds file.
There are many free tools online to do this, for example: http://aspirine.org/htpasswd_en.html

It should look something like this:
username1:$apr1$jOJbxFnw$eAwvmpz3x16UJX2.ja4/c/

Login to your hosting control panel.
Click Websites.
Click the Website we are protecting a folder on.
Disable (Untick) "Enable Integrated Windows Authentication" and click Save.

Now go to the url of the password protected folder in a browser and test it, you should see a login box and entering the username and password you created above should allow you to login.

Notes:

Ensure your application pool is in Integrated Mode (It is by default): https://portal.winserve.co.uk/knowledgebase.php?action=displayarticle&id=73


  • .htaccess, ape, helicon, password, protect, protection, user
  • 1040 Users Found This Useful
Was this answer helpful?

Related Articles

How to enable .htaccess support on your website (Helicon Ape).

We provide near 100% compatibility on our Windows servers for .htaccess files as used by Linux...

My .htaccess file is not working?

In order for your .htaccess files to work on our hosting platform you will need to ensure your...