location.html revision bf3d9f591e5af24fdcaa9029094dc045878d1d1a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BGCOLOR="#FFFFFF"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen TEXT="#000000"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LINK="#0000FF"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen VLINK="#000080"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ALINK="#FF0000"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!--#include virtual="header.html" -->
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<h2><a name="location">The <code><Location></code> Directive</a></h2>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<strong>Syntax:</strong> <Location <em>URL prefix</em>><br>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<strong>Context:</strong> server config, virtual host<br>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<p>The <Location> directive provides for access control by
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenURL. It is comparable to the <a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenhref="mod/core.html#directory"><Directory></a> directive, and
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenshould be matched with a </Location> directive. Directives that
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenapply to the URL given should be listen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenwithin. <code><Location></code> sections are processed in the
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenorder they appear in the configuration file, after the
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<Directory> sections and <code>.htaccess</code> files are
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<p>Note that, due to the way HTTP functions, <em>URL prefix</em>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenshould, save for proxy requests, be of the form <code>/path/</code>,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenand should not include the <code>http://servername</code>. It doesn't
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainennecessarily have to protect a directory (it can be an individual
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenfile, or a number of files), and can include wild-cards. In a wild-card
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstring, `?' matches any single character, and `*' matches any
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainensequences of characters.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<p>This functionality is especially useful when combined with the
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<code><a href="mod/mod_mime.html#sethandler">SetHandler</a></code>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirective. For example, to enable status requests, but allow them only
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenfrom browsers at foo.com, you might use:
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <Location /status>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen SetHandler server-status
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen order deny,allow
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen deny from all
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </Location>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!--#include virtual="footer.html" -->