What you need:
FTP access to your server
Notepad/Wordpad/...
Basig knowledge of websites
Let's get started:
Open Notepad and create a file. This needs to be in it:
Code:
AuthUserFile Directory
AuthName "Title of log-in screen"
AuthType Basic
Require valid-user
www/website/members/
You need to change "Title of log-in screen" to something you want. Don't forget to keep the quotes though.
Now, when using notepad, go to save as... and save it as ".htaccess" (without the ""). Don't forget to choose 'all types' and not .txt. Otherwise you can always rename the file to '.htaccess' in the FTP browser.
The .htpasswd needs to contain a username and a encrypted password. A good tool to encrypt passwords is found here:
Code:
http://home.flash.net/cgi-bin/pw.pl
Code:
username:p.whLw2ZDZroU
With notepad, save it as '.htpasswd' or again, rename it within the FTP browser.
Everything is set up now, though, make sure you got these things right:
You've put the .htpasswd file in the right directory you specified in the .htaccess file.
You've got the right names. '.htpasswd' and '.htaccess' and you are sure the .'s are there too.
You've put the .htaccess file in the directory on your server you want to protect.
You've encrypted the passwords.
Niciun comentariu:
Trimiteți un comentariu