Apache Directory Authentication

Discussion in 'Web Design and Development' started by KheeseKake, Oct 22, 2007.

  1. KheeseKake macrumors newbie

    Joined:
    Feb 26, 2007
    #1
    Hi there, I wasn't sure if this was the right place to post but couldn't find a category that seemed like it would match this topic better.

    Anyway, currently I am using running a Apache small web server on my old iMac running Tiger and I have a .htaccess file in the root web directory so that a password is required in order to access anything on the web server. How can I make an exception for just one directory to not require password authentication?

    e.g. http://www.domain.com or http://www.domain.com/any-other-directory will require authentication but http://www.domain.com/this-specific-directory won't require any authentication.

    I hope this makes sense to someone ;)

    Thanks in advance!
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    You can drop a .htaccess file into any directory and it will apply just to that directory and usually sub-directories from that point on. You should also be able to do it from your main .htaccess file, and that is usually the preferred way to do it so everything is in one place.

    Off hand I can't remember the specifics for what you need, but if I have time later I'll try to post something, but there's plenty of smart people here that'll post an answer before I get back.
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    OK, I think I found a solution for you, but admit I didn't try it myself. Add this to a .htaccess file in the directory where you don't want the password protection,
    Code:
    Satisfy Any
    Allow from All
    Here's a touch of reading on Satify, http://httpd.apache.org/docs/1.3/howto/auth.html#satisfy
     
  4. KheeseKake thread starter macrumors newbie

    Joined:
    Feb 26, 2007
    #4
    Ah thank you so much! This is exactly what I was looking for and works perfectly! :D
     

Share This Page