|
Posted by Lahg on February 01, 2001 at 00:18:22: In Reply to: Posted by on January 31, 2001 at 15:52:43: Theres a few different ways, but the easiest i know of is to do this.... Lets say the username is "smurf" and the password is "smurfy" ========== First, create a file to contain the username and password. Store this file on your server. (For security reasons, you should store it somewhere other than the root directory.) Most HTTP servers, including Apache and Netscape Enterprise Server, let you create this document with the htpasswd command. Type the following line from the Unix prompt: htpasswd -c /directory/path/.htpasswd Smurf To use this code, replace /directory/path/ with the Unix path to the password-protected file's location on your own site. You will be prompted for the password for Smurf; enter it twice. You can check that the .htpasswd file has been created at that location; it should contain something like: Smurf:y1ia3tjWkhCK2 Next, create a file in the secret directory that sets the permissions. Call the file .htaccess and include the following text: AuthUserFile / directory/path/.htpasswd require user Smurf Again, replace the /directory/path/ statement with your site's Unix path to the .htpasswd document. You can change the value for AuthName to whatever you want. ======= Hope that helps a bit Have a smurfy day =) (try the link too)
|