|
Password Protection
There are several ways to control access to your web pages, however, the two most common
are using the .htaccess file and CGI Scripts.
We'll step through the process of setting up your own .htaccess here and provide you
with several links to CGI password protection scripts out there on the Internet.
.htaccess
The .htaccess file is used to password protect a directory on your web server. There
are two files which are needed to complete the setup:
- .htaccess
- .htpasswd
- Creating the .htaccess file
To create your own .htaccess file, you simply create a file called .htaccess
that looks like this:
AuthUserFile /path/to/your/password/file/.htpasswd
AuthGroupFile /dev/null
AuthName WebTent Password Protected Directory
AuthType Basic
<LIMIT GET POST PUT>
require valid-user
</LIMIT>
You need to change the AuthUserFile to the absolute path of your .htpasswd file. For
details on specifying your directories on the server, see our directory section
of the WebTent Introduction to your new site. Also,
you can change the AuthName line to read anything you wish, this is the Resource name the user
will see when trying to access the protected directory. To see an example of the result, click
here.
- Creating the .htpasswd file
The easiest way to do this is to use the htpasswd script developed by FlashNet.
Just build the user name/password using the script, then copy/paste into your .htpasswd
file. Once you have completed your password file, just upload to your web site via
ftp.
Links to CGI Password Protection Scripts
Here are some links to CGI Scripts which provide
password protection for your web site:
Return to the Web Hosting Help Desk
|