How to create password protecting directories?

1) Create a .htaccess file and specify the following code in it,

AuthType Basic
AuthName “Adminsitration”
AuthUserFile /home/support/.htpasswd
require valid-user

2) To create a passwd file, use the following .htpasswd generator .It should allow you to generate a

username /  encrypted password pair.

http://www.desilva.biz/apache/pwdweb.html

The .htpasswd file will contain your username(s) and encrypted password(s) and will usually look like this:

christopher:En7Cr9pT2Ed/u
Mak3m0n3y

Place the .htaccess file in the directory that is to be protected.

And place the .htpasswd outside the directory that is to be protected.

Example:
If you want to protect a directory “blog” under a particular domain
then .htaccess file should be placed in the “blog” directory and the .htpasswd
file should be placed in the “html ” directory.

Note that all the directories that are created under the blog directory will also get protected.

  • 1 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

Can I use my domain name or must I use my IP address as the hostname for FTP?

Using your IP address (192.168.22.22  is an example IP address) is the preferred entry for...

Can you transfer my sites from my current host to my new VPS?

Yes. We will transfer all of your sites free* of charge and will assure that you experience no or...

Do you allow MP3 files? Do you allow streaming of videos?

Yes we do with our special plans at http://hostripples.in/avs-hosting.php

Do you support Cold Fusion?

We do not support or Cold Fusion on our shared hosting servers, however you are more than welcome...