Password protected directories

Placing a password on your World Wide Web pages is a multi-part process. Most of these steps are not difficult to accomplish.

First, all files that you want to be protected by password should be in a separate subdirectory. You may want to create a directory called "protected" in your Web page storage area for the pages you want behind a password. Most FTP programs will allow you to create new subdirectories in your account area.

You probably want something like this in your directory...


Then, create a file called ".htaccess" in the passworded (protected) directory that contains:


The file name MUST be .htaccess (yes, it starts with a period) and this file MUST be in the same directory with the files that are to be protected. (You probably do not want to put this in your primary Web area because this would result in your entire Web area being protected.)

Both files (.htaccess and .htpasswd) must be PURE TEXT or ASCII files. You CANNOT use your html editor to create these files. Most word processing programs allow you to save text as pure ascii. One of the problems seen frequently is that the program used to create the .htaccess file wants to add a ".txt" at the end of the file name. If this happens, the password protection will not work. The name must be .htaccess and nothing else.

The AuthUserFile shown above is the file containing the actual password needed for your file and it must include a full UNIX path to that location. For security reasons, the full UNIX path for your Web pages is not published here. Please contact support@conexim.com.au to obtain this information for your account.

The AuthName above contains the text people will see in the password entry box when they attempt to gain access to your page. It is best to keep this as short as possible. It is possible to place more than one word on this line by using quotation mark. For example:


will display the information above in the password box when users try to access the page.

The tool at the bottom of this page will help you create the text for the file storing your actual password.

In the example above, the name of the file holding the encrypted password is ".htpasswd". If you want to call the password file some other name, you will need to change the information on the AuthUserFile line in the .htaccess file.



Enter a user name:
Enter a password (to be encrypted):