Fubaredness Is Contagious

by Dmitriy Samovskiy

Fubaredness Is Contagious header image 2

Apache Config Trick: A Special Directory

June 21st, 2007 · No Comments

So say you need to require users to enter their username and password before they can get content from your Apache server? Well, that’s easy:

<Location "/">
AuthType ...
AuthName...
Require valid-user
...
</Location>

But what if you want to have one special directory where you don’t want to authenticate users? Extended regular expressions to the rescue (perldoc perlre)! Just change the first line in above code:

from

<Location "/">

to

<Location ~ "^/(?!special)">

Now authentication will be required for everything but /special.

Tags: linux

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment