You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wiki-changes@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2007/01/23 20:51:51 UTC

[Httpd Wiki] Update of "Recipes/BypassAuthenticationOrAuthorizationRequirements" by AskApache

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The following page has been changed by AskApache:
http://wiki.apache.org/httpd/Recipes/BypassAuthenticationOrAuthorizationRequirements

------------------------------------------------------------------------------
    Satisfy any
  </Directory>
  }}}
- This will force everyone from the outside to authenticate, but those coming from the LAN IP range would not be required to do so. Apache will let them access the directory without authenticating. You can add other hostnames (local or remote) to the Allow directive to give them access to the directory as well. See the Apache Docs on [http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow Allow].
+ This will force everyone from the outside to authenticate, but those coming from the LAN IP range would not be required to do so. Apache will let them access the directory without authenticating.
  
  This will also work with a subdirectory in your protected directory. Let's say you have a subdirectory in ''private'' called ''noprotect'' that you want to allow everyone access to without being prompted for credentials. You could do this:
  
@@ -61, +61 @@

  In this above example, the "Order allow,deny" line blocks access by default, the "Allow" directive allows the LAN, and the "Satisfy all" directive requires both LAN and password.
  
  
+ The following recipe incorporates the "Satisfy Any", "Allow", and "Order" directives to allow google, CSS and XHTML validation via w3.org, and the web-developer to access the site without being prompted for a password. Everyone else is prompted for a password.  This is especially useful for webmasters while working on a site. 
+ ''From [http://www.askapache.com/2006/htaccess/htaccesselite-ultimate-htaccess-article.html askapache]'' 
+ 
+ {{{AuthName "example.com Administration"
+ AuthUserFile /some/path/.htpasswd
+ AuthType basic
+ Require valid-user
+ Order deny,allow
+ Deny from all
+ Allow from 24.205.23.222 w3.org htmlhelp.com googlebot.com google.com google-analytics.com
+ Satisfy Any
+ }}}
+ 
+ 
  See the Apache Docs for further information on the [http://httpd.apache.org/docs/2.2/mod/core.html#satisfy Satisfy] directive.