.htaccess tutorial

htaccess Elite


Authenticate some(75) directories via htaccess

Security in htaccess: htpasswd, 401 Authentication

Authenticate some(75) directories via htaccess

Postby dank49 » 25 Jun 2008 22:02

We have 80 root level directories. 75 of them need to be authenticate via .htaccess but 5 do not need to authenticate. I can do by matching those 75 directory names using <FileMatch> in this way:

<FilesMatch "^(exec|env|doit|phpinfo|w)*$">
AuthName "Development"
AuthUserFile /.htpasswd
AuthType basic
Require valid-user
</FilesMatch>

But I would prefer to manage this by disabling authentication for the 5 directories using something like a NOT <FilesMatch> or similar rather than managing the 75.

Any help is greatly appreciated.

Thanks,
dank49
 
Posts: 2
Joined: 25 Jun 2008 21:42

Return to Security and Authentication



cron