Integra Customer Care
Welcome to Integra Telecom's Customer Care Center.
For additional assistance, contact us.

You have not selected a Service Area. (Select one)

Password Protect Your Site With .htaccess

How can I password protect a web page?

Certain file names have special purposes on a web server. A good example of this is index.html, which will automatically display in a web browser. Another file is .htaccess, but it never displays to visitors. What it does is look at the visitor and identifies such things as whether or not the visitor can even have a page displayed. A simple file with a few specific instructions in it, uploaded into the folder that you want to password protect, is basically all you need to do to protect that directory.

Password window

What is needed to make this happen?

No special tools are required to make the files. Any text editor, such as Notepad, will do. You will need to make a master password list which is usually called .htpasswd, and a .htaccess file is required in the parent folder that you want to have protected.

Please note that .htaccess files are only available on UNIX web servers.

The .htaccess file

Here is an example of what a basic file looks like:

AuthType Basic
AuthName "Authorized Users"
AuthUserFile /nfs/home/u/username/.htpasswd
require valid-user

Each line is pretty straight forward:

The master user list, .htpasswd

The master user list should no be inside of your public_html folder but rather on the same level. Here's an example of what this looks like:

user1:CzFUwKiiV87R2
user2:tYF.3ClkjNAeg

You can encrypt a password by entering your chosen username and password into this form:

Username:
Password:
  

More information on .htaccess

We have only slightly touched on the topic of this very powerful feature. There is a number of excellent resources available on this topic including JavaScriptKit's Comprehensive guide to .htaccess, The Apache Tutorial on .htaccess, or do a Google search for .htaccess.

<< Return to Web Hosting Support