location.html revision 44afbb2bc1622ddf021058e2a157cfd31fb67fd0
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<!--#include virtual="header.html" -->
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<h2><a name="location">The <code><Location></code> Directive</a></h2>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<strong>Syntax:</strong> <Location <em>URL prefix</em>><br>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<strong>Context:</strong> server config, virtual host<br>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<p>The <Location> directive provides for access control by
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistURL. It is comparable to the <a
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquisthref="/core.html#directory"><Directory></a> directive, and
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistshould be matched with a </Location> directive. Directives that
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistapply to the URL given should be listen
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistwithin. <code><Location></code> sections are processed in the
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistorder they appear in the configuration file, after the
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<Directory> sections and <code>.htaccess</code> files are
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<p>Note that, due to the way HTTP functions, <em>URL prefix</em>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistshould, save for proxy requests, be of the form <code>/path/</code>,
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistand should not include the <code>http://servername</code>. It doesn't
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistnecessarily have to protect a directory (it can be an individual
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistfile, or a number of files), and can include wild-cards. In a wild-card
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquiststring, `?' matches any single character, and `*' matches any
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistsequences of characters.
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<p>This functionality is especially useful when combined with the
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<code><a href="/mod_mime.html#sethandler">SetHandler</a></code>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistdirective. For example, to enable status requests, but allow them only
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquistfrom browsers at foo.com, you might use:
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist <Location /status>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist SetHandler server-status
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist order deny,allow
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist deny from all
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist </Location>
33a28b94ce2e89da8d1ca8d1b7c517907c141606patricklundquist<!--#include virtual="footer.html" -->