Allowing full access to a sub directory in Apache Server

Posted on Thu Mar 09 15:47:00 UTC 2006

I realize this is somewhat off topic here, but it wasn’t obvious to me, and it took quite a few google searches to come up a hints, so I thought someone might benefit from this.

I had what I thought was a pretty simple problem. I have a site that is currenlty protected by a password. You know, something like:

AuthType Basic
AuthName “Allow Specific Users”
AuthLDAPURL ldap://localhost:389/dc=domain,dc=com?uid?sub?(objectClass=*)
require valid-user

to protect the whole site. Now, I also needed a subdirectory to be accessible without a password.

That’s easy, I thought, I probably just need to create a or a .htaccess with AuthType None or something. Not so fast! After quite a while, I was starting to think that the only solution was going to be to set the root public, and protect all the sub directories but one.

But in fact the solution is very simple:

just create a .htaccess file and include:

Allow from all
Satisfy Any

And that’s it! Turns out Satisfy Any will let people in if either the require or the Allow matches.

Posted in Quid Pro Quo  |  Tags ,  |  6 comments

Comments

  1. Shayan Ghazizadeh Shayan Ghazizadeh said // Mar 24, 2007 at 01:11 PM

    Thank you! This was super useful. Saved me a bunch of time :-)

  2. Julio Julio said // Jun 06, 2007 at 04:11 AM

    Many thanks, it works perfectly :)

  3. Chris Chris said // Jul 03, 2007 at 01:59 PM

    Many thanks! this solved my problem instantly!

  4. Webmaster from Finland Webmaster from Finland said // Sep 06, 2007 at 12:50 AM

    Thank you! You just saved my life :)

  5. www.usrbin.com www.usrbin.com said // Feb 01, 2008 at 05:51 PM

    Thank you! You just saved me a bunch of hair-pulling!

  6. Dr J Dr J said // Apr 02, 2008 at 07:39 AM

    Thanks – well googled and applied quickly….

(leave url/email »)

Comment Markup Help