|
Step 1 - Creating the .htaccess file Begin by opening your favorite text editor (i.e. Notepad) and type the following information: AuthType Basic AuthUserFile /home/u/username/public_html/directory/.htpasswd AuthName Secret require valid-user In the "AuthUserFile" line change the letter u "/u/" in the listed path to the first letter of your username and the word username "/username/" into your username. For example, someuser@netdoor.com would then make this line read: AuthUserFile /home/s/someuser/public_html/directory/.htpasswd Also the word directory "/directory/" needs to be the directory or folder name where the .htpasswd file is to be located. Note: For security reasons it is always best to put your .htpasswd file into a different directory than your .htaccess file. Once this is done you'll need to save the file as directed below.
Step 2 - Creating the .htpasswd file Once again you will need to open your favorite text editor to create this file. First you will need to choose a password and encrypt this password for use in the .htpasswd file. Encrypting is a security measure that makes the password unreadable if anyone were to gain access to your .htpasswd file. You can use this link to encrypt the password. Once there, enter a username used with your .htaccess file and the password chosen for that username and click the "Generate" button. The next page you see will include output similar to "someuser:8oYh2wr177j8o". Copy and paste the ouput to your text editor (be sure to get the whole line or it will not work) and then save it as ".htpasswd" in the same way that you saved your .htaccess file above. Now you can upload the .htaccess file into the directory to be protected and the .htpasswd to the directory specified in your .htaccess file. Please note: When uploading text based files such as these, please make sure that you are uploading in ASCII format. Most FTP programs include this option. If all goes well then upon accessing the directory containing the .htaccess file with your web browser you will be prompted for a username and password. Simply verify that the specified username and password allows access to that directory and you are done. Troubleshooting
|