Password Protection

Caution- You can create problems if you do not read carefully and understand what you are doing.

For most of us, our hosting is done on a Linux/Unix operating system and uses Apache as the webserver software. Here is a link to the Apache site on this subject.

http://httpd.apache.org/docs-2.0/howto/auth.html

.htaccess (that is the entire file name) is the file that is used to control access to individual folders on your website.

How To Password Protect Part of Your Website

 There are some situations in which you might want to restrict access to part of your website. You might put certain pages in a particular folder and require a user name and password for anyone to see any pages in that folder.

 Reasons to Protect a Folder

 

How To Setup Password Protection

Depending on your hosting account, you might have a way to password protect a folder through your Control Panel for your account. Sometimes, however you might be able to only set one username and one password. This might work OK sometimes, but not for members folders. For them you would want to enter a username and a password for each member so that they could be removed if they lost their membership privileges.

The .htaccess file

On Unix/Linux hosting there is a file called “.htaccess” which can control access to folders on your website. It is a plain text file and you can modify it to do what you would like to do, if you know what to add to the file. But there is a possibility that your hosting account will not allow you access to it because, if a person edited it without knowing what they were doing, they could create problems.

Commercial Products

There are commercial programs available ranging from $10 to over $100 depending on how sophisticated they were and how many options and features they might include.

Search for “scripts” and you will find a few sites that contain a wide and varied collection of all kinds of them. Once at one of these look for User Authentication or User Management to find scripts for password protecting a part of your website.

http://www.hotscripts.com/  www.dynamicdrive.com/  www.scriptsearch.com/

I did quite a bit of searching and found and tried one that turned out to be fairly easy to understand and to install and get to work. It was call PHPAccess. It is a free php script that will allow you to easily password protect a web folder (web directory). Just download the file, unzip it and upload one file to the directory that you want to protect. It has an administrator page from which you can add users and passwords one at a time or import a text file of names and passwords to add many at once.

Download it here:

http://www.krizleebear.de/phpaccess/dynamisch/index.php?pageID=5

See an example of a directory protected with the above program:

http://dollarware-hosting.com/pw/  

For access enter>> username: user       password: abc