| Sometimes you may want to restrict
access to particular sections of your web site. These sections
may include internal area, private pictures, subscriber's
journal, internal documents, such as doc and PDF files and
etc.
The quickest, easiest and safest way of doing this is
to use the Basic HTTP Authentication method. Over 80%
of web servers on the internet is Apache web server which
support this method very well. So if you have an Apache
web server, you can easily password protect your web directory
and your web site without bothering your web hosting administrator.
To use this method to password protect your web directory,
you need to write two files: .htaccess and .htpasswd.
And how to write them? Don't worry, Htpasswd Generator
is just the answer.
The first file is .htpasswd, it defines the user/password
list. For example, you now have two valid users: Bob with
password BBBBBB, and Tom with password TTTTTT. The file
may look like this:
Bob:JZ1w.CMkwXdCI
Tom:igFtfTrbpDnTY
To the left of the colon is user name, to the right is
encrypted password. You can use Htpasswd Generator
to manage your user/password database ,encrypt the password
into proper encrypted string and generate the .htpasswd
file.
The second file .htaccess must be placed in the directory
you wish to password protect, and if you place this file
in your web root directory, it will password protect your
entire web site. The .htaccess file may look like this:
AuthUserFile /home/loginname/.htpasswd
AuthName Please login first
AuthType Basic
require valid-user
The first line is the full host path to the .htpasswd
file. Please note that this is not a URL, and this is
not a FTP server path, this is a full host path. The second
line is the text that shows in password dialog.
With just few clicks, Htpasswd Generator Wizard
will make these two files easily, and then you can use
Htpasswd Generator to upload .htpasswd file to
the directory defined in the .htaccess file, and upload
.htaccess file to the web directory you want to password
protect. |