location.html revision f9b3be308809978f797e0c57b296147532a4313c
198N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
198N/A<HTML>
198N/A<HEAD>
198N/A<TITLE>Access Control by URL</TITLE>
198N/A</HEAD>
198N/A
198N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
198N/A<BODY
198N/A BGCOLOR="#FFFFFF"
198N/A TEXT="#000000"
198N/A LINK="#0000FF"
198N/A VLINK="#000080"
198N/A ALINK="#FF0000"
198N/A>
198N/A<!--#include virtual="header.html" -->
198N/A<H1 ALIGN="CENTER">Access Control by URL</H1>
198N/A
198N/A<h2><A name="location">The <CODE>&lt;Location&gt;</CODE> Directive</A></h2>
198N/A
198N/A<STRONG>Syntax:</STRONG> &lt;Location <EM>URL prefix</EM>&gt;<BR>
198N/A<STRONG>Context:</STRONG> server config, virtual host<BR>
198N/A<STRONG>Status:</STRONG> core<BR>
198N/A
198N/A<P>The &lt;Location&gt; directive provides for access control by
198N/AURL. It is comparable to the <A
198N/AHREF="mod/core.html#directory">&lt;Directory&gt;</A> directive, and
198N/Ashould be matched with a &lt;/Location&gt; directive. Directives that
198N/Aapply to the URL given should be listen
198N/Awithin. <CODE>&lt;Location&gt;</CODE> sections are processed in the
198N/Aorder they appear in the configuration file, after the
379N/A&lt;Directory&gt; sections and <CODE>.htaccess</CODE> files are
379N/Aread.</P>
379N/A
198N/A<P>Note that, due to the way HTTP functions, <EM>URL prefix</EM>
379N/Ashould, save for proxy requests, be of the form <CODE>/path/</CODE>,
379N/Aand should not include the <CODE>http://servername</CODE>. It doesn't
379N/Anecessarily have to protect a directory (it can be an individual
379N/Afile, or a number of files), and can include wild-cards. In a wild-card
379N/Astring, `?' matches any single character, and `*' matches any
198N/Asequences of characters.
198N/A
198N/A<P>This functionality is especially useful when combined with the
198N/A<CODE><A HREF="mod/mod_mime.html#sethandler">SetHandler</A></CODE>
198N/Adirective. For example, to enable status requests, but allow them only
379N/Afrom browsers at foo.com, you might use:
379N/A
379N/A<PRE>
379N/A &lt;Location /status&gt;
379N/A SetHandler server-status
379N/A order deny,allow
379N/A deny from all
379N/A allow from .foo.com
379N/A &lt;/Location&gt;
379N/A</PRE>
379N/A
379N/A<!--#include virtual="footer.html" -->
379N/A</BODY>
379N/A</HTML>
379N/A
379N/A