From: Alexei Kosut
+Syntax: <Files filename>
+... </Files>
+
+ The <Files> directive provides for access control by
+filename. It is comparable to the <Directory> directive and
+<Location> directives. It
+should be matched with a </Files> directive. Directives that
+apply to the filename given should be listed
+within. The filename 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 Note that unlike
@@ -314,12 +344,23 @@ of that directory. Any directive which is allowed in a directory
context may be used. Directory 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:
- Apache 1.2 and above:
+Extended regular expressions can also be used, with the addition of the
+
+
+ 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
.htaccess files. For example, with
@@ -530,7 +571,8 @@ then it applies to all access methods. This functionality is especially useful when combined with the
- Apache 1.2 and above:
+Extended regular expressions can also be used, with the addition of
+the
+
<Files>
-Syntax: <Files regexp>
-Context: server config, virtualhost, directory
-Status: Core.
+Context: server config, virtual host, htaccess
+Status: core
+Compatibility: only available in Apache
+1.2 and above.<Files>
sections are processed in the
+order they appear in the configuration file, after the
+<Directory> sections and .htaccess
files are
+read, but before <Location> sections.~
character. For example:
+ <Files ~ "\.(gif|jpe?g|png)$">
+
+
+would match most common Internet graphics formats.
+
+<Directory>
and <Location>
sections,
+<Files>
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
+filename does not begin with a /
character,
+the directory being applied will be prefixed automatically.
@@ -303,8 +334,7 @@ with filenames missing the .gif extension.
<Directory> directive
-Syntax: <Directory directory> ...
-</Directory>
+Syntax: <Directory directory> ... </Directory>
Context: server config, virtual host
Status: Core.
-
-If multiple directory sections match the directory (or its parents) containing
+
-<Directory /usr/local/httpd/htdocs>
-Options Indexes FollowSymLinks
-</Directory>
+ <Directory /usr/local/httpd/htdocs>
+ Options Indexes FollowSymLinks
+ </Directory>
+
+
+~
character. For example:
+ <Directory ~ "^/www/.*/[0-9]{3}">
+
+
+would match directories in /www/ that consisted of three numbers.
<Location>
-Syntax: <Location URL prefix>
+Syntax: <Location URL>
+... </Location>
Context: server config, virtual host
Status: core
Compatibility: Location is only available in Apache
@@ -554,9 +596,21 @@ file, or a number of files), and can include wildcards. In a wildcard
string, `?' matches any single character, and `*' matches any
sequences of characters.
-SetHandler
-directive. For example, to enable status requests, but allow them only
+~
character. For example:
+ <Location ~ "/(extra|special)/data">
+
+
+would match URLs that contained the substring "/extra/data" or
+"/special/data".
The Location
functionality is especially useful when
+combined with the SetHandler
directive. For example, to enable status requests, but allow them only
from browsers at foo.com, you might use: