Allowing full access to a sub directory in Apache Server

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.

Tags: ,

8 Responses to “Allowing full access to a sub directory in Apache Server”

  1. Shayan Ghazizadeh March 9, 2006 at 11:47 pm #

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

  2. Julio March 9, 2006 at 11:47 pm #

    Many thanks, it works perfectly :)

  3. Chris March 9, 2006 at 11:47 pm #

    Many thanks! this solved my problem instantly!

  4. Webmaster from Finland March 9, 2006 at 11:47 pm #

    Thank you! You just saved my life :)

  5. www.usrbin.com March 9, 2006 at 11:47 pm #

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

  6. Dr J March 9, 2006 at 11:47 pm #

    Thanks – well googled and applied quickly….

  7. me March 9, 2006 at 11:47 pm #

    I idd took advantage from that – thank you :-)

  8. jutzin March 9, 2006 at 11:47 pm #

    gracias, real timesaver