1and1 Help Centre Categories

print article

Set Up Protected Directories

Follow the steps below to password protect a section of your website files so only those with the password are able to view it.

Password protection is enabled via the .htaccess file. If there is no .htaccess file already in the folder you wish to protect, one will be created for you.

Please note:
If you already have an .htaccess file in the folder you are about to protect, it will be overwritten!

It is suggested that you backup your .htaccess file beforehand. You may then edit the file and append your original text to the .htaccess file after it is overwritten. You may also edit your existing .htaccess file manually to enable password protection on the folder if you are familiar with the process rather than following the steps below.

Step 1
Log in to your 1&1 Control Panel and select the relevant package.
Step 2
Click the Protected Directories link from the Hosting panel.
Protected Directories
Protected Directories

Step 3
Click the New User button. New user window
New user window
Step 4
Enter a User name, Password and Description.

To choose an existing directory, select it from the drop-down box as show in the picture below.

To create a new directory, select the Create new directory radio button and type the folder name into the text box. When complete, click the Save button.
Protected directories window

Protected directories window

Repeat as necessary if you wish to give the user access to multiple folders.

Step 5
You should see a list of the directories that will accessible by the new user. When you are finished, click the OK button at the bottom of the page.
List of directories
List of directories
Step 6
You are shown a confirmation page that the user will be created. Click the Go To Overview button to return to the Protected Directories section of the 1&1 Control Panel. Successful setup notification
Successful setup notification
Please note:
A file named .htaccess is placed in the directory being protected. If this file is removed, the directory is no longer password protected.
For additional information, you may want to reference: