You are located in service: Webhosting

Request .htaccess Protection

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 satisfy all

require host

The line allow from respectively require host 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


require valid-user

Absolute path

To make out the absolute path of your website:

  1. Create a new .php file in the directory in which .htusers is located.
  2. Copy the following lines in this file:

    <?php header("Content-type: text/plain"); $pfad = dirname($_SERVER['SCRIPT_FILENAME']); echo "AuthUserFile $pfad/.htusers\n\n"; ?>

  3. Upload the file call up the file in your browser.

The browser's output should look like this:


AuthUserFile /e/fxx/home/websites/name/v-schutz/.htusers

This line will be inserted in the .htaccess file.

last changed on 01/29/2021

How did this content help you?

Creative Commons Lizenzvertrag
This work is licensed under a Creative Commons Attribution - Share Alike 3.0 Germany License