Password Protecting your pages
Copy the lines below and put them in a file named .htaccess, You can make this file in any text editor. Be sure to modify the line named AuthUserFile below. Notice the last part of the AuthUserFile, service.pwd. This is the file that you need to put the username password pairs into, you can create this file in any text editor. The username and password pairs need to be encrypted through your console.
---------------------------COPY BELOW----------------------------- # This is the configuration file for you to password protect a directory. # # NOTE: Make sure you put the correct path to the directory you are # trying to protect after the AuthUserFile line below. Also make # sure you put this .htaccess file in the directory that you are trying to # to protect and the service.pwd also in the directory that you # are trying to protect. ###########################################################################
AuthType Basic AuthName PasswordAdmin AuthUserFile /web/disk1/virtual/megaton.net/accounts/yourdomain.xxx/htdocs/cgi-bin/service.pwd require valid-user ---------------------------COPY ABOVE-----------------------------
The AuthUserFile
line is very important. There are a few things
that must be correct on this line.
AuthUserFile <path>
directive must be on one line.
<path>
must be the full path on the server. You can
determine the correct path to use by logging into your console. At the bottom
of the main screen, you will see in small print
The line following is the full path to your htdocs directory. Just
add /cgi-bin/service.pwd
to the end of this path and you will
have the correct path for the AuthUserFile
line.
How do I encrypt the passwords?
You will need to use the http encryption utility in your account console and put them in a file named service.pwd, you can create this file in any text editor. The username password pairs should look something like this:
Megatontech:00hzYw5m.HyAY
Notice that there is a space at the end of the encrypted password if you
click and drag you mouse over it like you were going to copy it, this is
very important and is usually left out when it gets copied and pasted into
the service.pwd file.
Why doesn't this work for me, I think I did it right?
Make sure that when you encrypt the password you get the whole line copied
to paste into the htpasswd file. Most of the time the last character
doesn't get copied, which happens to be a space.