Protection htpasswd

Commande en usage basique de protection de répertoire par authentification HTTP.

Créer un fichier .htpasswd s’il n’existe pas :

htpasswd -c .htpasswd user

Lorsque le fichier .htpasswd existe déjà et qu’on souhaite ajouter un couple user/password :

htpasswd .htpasswd user

Le fichier .htaccess doit contenir ceci :

AuthUserFile /<PATH>/.htpasswd
AuthName "Veuillez vous identifier"
AuthType Basic
<Limit GET POST>
    require valid-user
</Limit>