1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4<html xmlns="http://www.w3.org/1999/xhtml">
5  <head>
6    <meta name="generator" content="HTML Tidy, see www.w3.org" />
7
8    <title>Access Control by URL</title>
9  </head>
10  <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
11
12  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
13  vlink="#000080" alink="#FF0000">
14        <div align="CENTER">
15      <img src="images/sub.gif" alt="[APACHE DOCUMENTATION]" />
16
17      <h3>Apache HTTP Server</h3>
18    </div>
19
20
21
22    <h1 align="CENTER">Access Control by URL</h1>
23
24    <h2><a id="location" name="location">The
25    <code>&lt;Location&gt;</code> Directive</a></h2>
26    <a href="mod/directive-dict.html#Syntax"
27    rel="Help"><strong>Syntax:</strong></a> &lt;Location <em>URL
28    prefix</em>&gt;<br />
29     <a href="mod/directive-dict.html#Context"
30    rel="Help"><strong>Context:</strong></a> server config, virtual
31    host<br />
32     <a href="mod/directive-dict.html#Status"
33    rel="Help"><strong>Status:</strong></a> core<br />
34
35
36    <p>The &lt;Location&gt; directive provides for access control
37    by URL. It is comparable to the <a
38    href="mod/core.html#directory">&lt;Directory&gt;</a> directive,
39    and should be matched with a &lt;/Location&gt; directive.
40    Directives that apply to the URL given should be listed between
41    them. <code>&lt;Location&gt;</code> sections are processed in
42    the order they appear in the configuration file, after the
43    &lt;Directory&gt; sections and <code>.htaccess</code> files are
44    read.</p>
45
46    <p>Note that, due to the way HTTP functions, <em>URL
47    prefix</em> should, save for proxy requests, be of the form
48    <code>/path/</code>, and should not include the
49    <code>http://servername</code>. It doesn't necessarily have to
50    protect a directory (it can be an individual file, or a number
51    of files), and can include wild-cards. In a wild-card string,
52    `?' matches any single character, and `*' matches any sequences
53    of characters.</p>
54
55    <p>This functionality is especially useful when combined with
56    the <code><a
57    href="mod/mod_mime.html#sethandler">SetHandler</a></code>
58    directive. For example, to enable status requests, but allow
59    them only from browsers at foo.com, you might use:</p>
60<pre>
61    &lt;Location /status&gt;
62    SetHandler server-status
63    Order Deny,Allow
64    Deny from all
65    Allow from .foo.com
66    &lt;/Location&gt;
67</pre>
68        <hr />
69
70    <h3 align="CENTER">Apache HTTP Server</h3>
71    <a href="./"><img src="images/index.gif" alt="Index" /></a>
72
73  </body>
74</html>
75
76