Site's Administration : Password protecting directories
Contents ]
Dr Benton

Creating the Private Access File

To restrict the access to certain private pages, you have to store them in a password protected directory. To do this, proceed as follows:

  1. Create the directory to be password protected

  2. Create the private access file in your favourite text editor:

  3. AuthUserFile /data/members/free/tripod/uk/o/l/i/oliviari/htdocs/secret/.htpasswd
    AuthGroupFile /dev/null
    AuthName PasswdProtection
    AuthType Basic
    <Limit GET>
    require user user
    </Limit>

    Elements shown in red in the previous code excerpt are parameters that need to be customised to reflect your account and the directory to be protected (more about this later on).

    Don't forget to put a dot before the filename and to keep the line breaks and upper case/lower case markings.

    The .htaccess and .htpasswd files have to be created in a text editor such as NotePad or BBEdit. It will not work if you use a HTML editor such as Netscape Composer, FrontPage, DreamWeaver, etc.

  4. Save this file under .htaccess.

Windows and DOS will not allow you to save this file as .htaccess. To bypass this problem, assign it a temporary name (for instance, access.txt) and then rename it .htaccess, either during or after the transfer, using your file transfer software (FTP client).



1   2   3   4