Using stigotd's method, you can do the same thing using .htaccess. I think it's a lot easier.
Create two files
.htaccess
.htpasswd
(notice no .txt or similar extensions)
.htaccess should lookk like this
AuthUserFile /home/webs/digimaxg/http/html/admin/1/admin/.htpasswd
AuthName "Secure Area"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
where /home/webs/digimaxg/http/html/admin/1/admin is the path to .htpasswd
.htpasswd looks like this
digimax:CdD36Ig7Uq4Jk
digimax is the username, CdD36Ig7Uq4Jk is the encryupted password, : seperates them. But essentially, looks like this:
user:pass
user2:pass2
user3:pass3
and you can add as many users as you want. If you go to http://www.virtualave.net/t/development/html/passencrypt
Type the password in the form, hit encrypt, and it will encrypt the password. Then copy and paste (make sure you don't get spaces) that in the format above.
user:encrypted_pass
Put both those files in the directory you want to protect and whalaa!
Cgraz