Controlling Web Page Access With HTAccess
from http://www.mcs.kent.edu/system/web_help/htaccess/introduction.html
Creating a .htaccess file
The .htaccess file should be created in the directory you which to protect.
This could be your entire public_html directory, or a subdirectory of your
public_html directory. Once a .htaccess file has been placed in a directory,
everything in that directory (including all subdirectories and their contents)
will be protected.
The .htaccess file contains the instructions for determining who is
allowed to access the directory. There are two sections of the .htaccess
file:
-
The first section of .htaccess must contain 4 lines:
AuthUserFile {path to .htpasswd file}
AuthGroupFile {path to .htgroup file}
AuthName {title for dialog box}
AuthType Basic
-
The second section must contain 3 parts:
<Limit GET>
{access instruction to be executed}
</Limit>
Note: If your title on the AuthName line is longer than one word,
the title must be enclosed in double quotes.
Example