entete eBusiness.be

La FAQ eBusiness

FAQ  > Programming and technique > How to limit access to a directory ?

You have to include 2 files in the directory you want to protect: .htaccess and .htpasswd.
Here are the contents of the 2 files to protect the access to the protected directory of the user monlogin. Contents of file .htaccess

AuthUserFile /home/monlogin/public_html/protege/.htpasswd
AuthGroupFile /dev/null
AuthName "Zone Accès Limité"
AuthType Basic
<Limit GET POST>
require valid-user

Contents of the file .htpasswd

login1:mot de passe1 crypté
login2:mot de passe2 crypté
login3:mot de passe3 crypté

Crypted password corresponds to the user password that you have encrypted with the utility that you will find here http://www.ebusiness.be/cgi-public/...

The contents of the file .htpasswd look something like this :