oreilly.comSafari Books Online.Conferences.

Apache FAQ
Linux FAQ

Log in to particpate

   Apache FAQ > G. Authentication and Access Restrictions
Question:  How do I set up Apache to allow access to certain documents only if a site is either a local site or the user supplies a password and username?

Use the Satisfy directive, in particular the Satisfy Any directive, to require that only one of the access restrictions be met. For example, adding the following configuration to a .htaccess or server configuration file would restrict access to people who either are accessing the site from a host under or who can supply a valid username and password:

Deny from all
Allow from
AuthType Basic
AuthUserFile /usr/local/apache/conf/htpasswd.users
AuthName "special directory"
Require valid-user
Satisfy any

See the user authentication question and the mod_access module for details on how the above directives work.

This FAQ is from Apache Server Frequently Asked Questions

Sponsored by: