Password Protection

Article No. 194
Created: 04:34 AM 12.26.03
Author: HPU Support [Link: support@homepageuniverse.com]
Original URL: https://my.homepageuniverse.com/support/knowledgebase/question.php?qstId=194


If you'd 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.
 

Note: If you already have a .htaccess file you'd like to use, amend the following to the existing .htaccess file.

Open Notepad (or equivalent software depending on your OS) and paste in the following:

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

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

yoursite.com = Your Site's Web Address
AuthName "test" <- Can be changed to whatever you want

Note: If you already have a .htpasswd file you'd like to use, amend the following to the existing .htpasswd file.

Open Notepad (or equivalent software depending on your OS) and enter the following:

Username:Password

Note: The password should be encrypted. You can encrypt the password here [Link: http://nexusportal.net/resources/password-generator/].

Upload both the htaccess.txt and htpasswd.txt files to the directory you wish to password protect, not the httpdocs folder, in ASCII mode. After uploading, right click the file (server copy) and choose rename. Edit the file name so that they will be .htaccess and .htpasswd (add a . to the beginning and drop the .txt extension)

Back to original article