Company
Real 24/7 Support

Our techs are ALWAYS here! When you have an issue we are here to solve it immediately - 24 hours a day and 7 days a week. We are here for you!

Domain Registration
  

Register a .com, .net, .org, .biz, .info, or .us domain name for just $12.95/yr! Retain full control and full ownership via your account at NexusDomains.

Htaccess Tutorials

Password Protection

Htaccess is simply a text file. A text file can be created in various text editors, including notepad. Some people are confused by the name of this file, so allow me to explain:

.htaccess is the file name. It is not file.htaccess or somepage.htaccess, it is just .htaccess

Disclaimer: If you are using FrontPage to publish your site and have the FrontPage extension turned ON, this tutorial will not work for you. FrontPage already has this feature built in.

If you would like to add password protection there are two ways to accomplish this task 1) Using Plesk's Directory Protection or 2) Using an .htaccess and .htpasswd system. To do the latter, simply follow the tutorial laid out for you below.

CREATE HTACCESS FILE

Note: If you already have a .htaccess file you would like to use, add the following to the existing .htaccess file.

Open a text editor (i.e. Notepad) and paste in the following:

AuthUserFile /home/httpd/vhosts/example.com/httpdocs/folder/to/protect/.htpasswd
AuthGroupFile /dev/null
AuthName "test"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

example.com = your web site address
AuthName "test" can be changed to whatever you want

CREATE HTPASSWD FILE

Note: If you already have a .htpasswd file you would like to use, add the following to the existing .htpasswd file.

Open a text editor (i.e. Notepad) and enter the following:

Username:Password

UPLOAD HTACCESS/HTPASSWD FILE

Upload both the htaccess.txt and htpasswd.txt files to the directory you wish to password protect (not the httpdocs folder). Rename the files to .htaccess and .htpasswd (add a . to the beginning and drop the .txt extension)