Request .htaccess Protection
Creation of directory protection
To create a protection for directory you have to set a file .htaccess. The related password file is .htusers and contains the user name and the coded password.
AuthType Basic AuthName "Privater-Bereich" AuthUserFile Absolute_Path/.htusers require user Peter
If you would like to have in addition to the password's query an access constraint for computer names or IP addresses, you have to add following lines:
order deny,allow deny from all allow from .rwth-aachen.de satisfy all
require host .rwth-aachen.de
The line allow from .rwth-aachen.de respectively require host .rwth-aachen.de causes that you can only access to the subdirectory in the RWTH network. (more information e.g. at SELFHTML)
To have more than one person access authorized, the instruction is:
require user Peter Paul Rubens
or for all users who are listed in .htusers
To make out the absolute path of your website:
- Create a new .php file in the directory in which .htusers is located.
Copy the following lines in this file:
<?php header("Content-type: text/plain"); $pfad = dirname($_SERVER['SCRIPT_FILENAME']); echo "AuthUserFile $pfad/.htusers\n\n"; ?>
- Upload the file call up the file in your browser.
The browser's output should look like this:
This line will be inserted in the .htaccess file.