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