<p><hr>
<A name="files"><h2><Files></h2></A>
-<strong>Syntax:</strong> <Files <em>regexp</em>><BR>
-<strong>Context:</strong> server config, virtualhost, directory<br>
-<strong>Status:</strong> Core. <p>
+<strong>Syntax:</strong> <Files <em>filename</em>>
+... </Files><br>
+<strong>Context:</strong> server config, virtual host, htaccess<br>
+<strong>Status:</strong> core<br>
+<strong>Compatibility:</strong> only available in Apache
+1.2 and above.<p>
+
+<p>The <Files> directive provides for access control by
+filename. It is comparable to the <a
+href="#directory"><Directory></a> directive and
+<a href="#location"><Location></a> directives. It
+should be matched with a </Files> directive. Directives that
+apply to the filename given should be listed
+within. <code><Files></code> sections are processed in the
+order they appear in the configuration file, after the
+<Directory> sections and <code>.htaccess</code> files are
+read, but before <Location> sections.</p>
-The File container applies the directives within to files
-which match the regexp.
+<p>The <em>filename</em> argument should include a filename, or a
+wildcard string, where `?' matches any single character, and `*' matches any
+sequences of characters. Extended regular expressions can also be used, with the addition of
+the <code>~</code> character. For example:</p>
+
+<pre>
+ <Files ~ "\.(gif|jpe?g|png)$">
+</pre>
+
+would match most common Internet graphics formats.
+
+<p>Note that unlike <a
+href="#directory"><code><Directory></code></a> and <a
+href="#location"><code><Location></code></a> sections,
+<code><Files></code> sections can be used inside .htaccess
+files. This allows users to control access to their own files, at a
+file-by-file level. When used in an .htaccess file, if the
+<em>filename</em> does not begin with a <code>/</code> character,
+the directory being applied will be prefixed automatically.
<p> <hr>
<A name="directory"><h2><Directory> directive</h2></A>
<!--%plaintext <?INDEX {\tt Directory} section directive> -->
-<strong>Syntax:</strong> <Directory <em>directory</em>> ...
-</Directory> <br>
+<strong>Syntax:</strong> <Directory <em>directory</em>> ... </Directory> <br>
<strong>Context:</strong> server config, virtual host<br>
<strong>Status:</strong> Core. <p>
context may be used. <em>Directory</em> is either the full path to a directory,
or a wildcard string. In a wildcard string, `?' matches any single character,
and `*' matches any sequences of characters. Example:
-<blockquote>
-<code>
-<Directory /usr/local/httpd/htdocs><br>
-Options Indexes FollowSymLinks<br>
-</Directory></code></blockquote>
-If multiple directory sections match the directory (or its parents) containing
+<pre>
+ <Directory /usr/local/httpd/htdocs>
+ Options Indexes FollowSymLinks
+ </Directory>
+</pre>
+
+<p><strong>Apache 1.2 and above:</strong>
+Extended regular expressions can also be used, with the addition of the
+<code>~</code> character. For example:</p>
+
+<pre>
+ <Directory ~ "^/www/.*/[0-9]{3}">
+</pre>
+
+would match directories in /www/ that consisted of three numbers.<p>
+
+<p>If multiple directory sections match the directory (or its parents) containing
a document, then the directives are applied in the order of shortest match
first, interspersed with the directives from the
<A HREF="#accessfilename">.htaccess</A> files. For example, with
<h2><a name="location"><Location></a></h2>
-<strong>Syntax:</strong> <Location <em>URL prefix</em>><br>
+<strong>Syntax:</strong> <Location <em>URL</em>>
+... </Location><br>
<strong>Context:</strong> server config, virtual host<br>
<strong>Status:</strong> core<br>
<strong>Compatibility:</strong> Location is only available in Apache
string, `?' matches any single character, and `*' matches any
sequences of characters.
-<p>This functionality is especially useful when combined with the
-<code><a href="mod_mime.html#sethandler">SetHandler</a></code>
-directive. For example, to enable status requests, but allow them only
+<p><strong>Apache 1.2 and above:</strong>
+Extended regular expressions can also be used, with the addition of
+the
+<code>~</code> character. For example:</p>
+
+<pre>
+ <Location ~ "/(extra|special)/data">
+</pre>
+
+would match URLs that contained the substring "/extra/data" or
+"/special/data".</p>
+
+<p>The <code>Location</code> functionality is especially useful when
+combined with the <code><a
+href="mod_mime.html#sethandler">SetHandler</a></code> directive. For example, to enable status requests, but allow them only
from browsers at foo.com, you might use:
<pre>