Maxime Chambreuil

Monday July 2, 2007

How can I protect a part of a website ?

Max @ 22:14 | Filed under: Information Technology

You have to create an .htaccess file in the directory you want to protect. Here is an example of the syntax :

AuthUserFile /home/*/*/protected/.htpasswd 
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

Then you just have to use the htpasswd command of the Apache Web Server to create a base of users and encrypted passwords :

# htpasswd -c .htpasswd user

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Copyright © Maxime Chambreuil