<Directory> and <DirectoryMatch>
<Directory dir > ... </Directory>
The <Directory>
directive allows you to apply
other directives to a directory or a group of directories. It is
important to understand that dir
refers to
absolute directories, so that <Directory
/>
operates on the whole filesystem,
not the DocumentRoot
and
below. dir
can include
wildcards — that is, ?
to match a single
character, *
to match a sequence, and [
]
to enclose a range of characters. For instance,
[a-d]
means “any one of a, b, c,
d.” If the character ~
appears in
front of dir
, the name can consist of
complete regular expressions.[4]
<DirectoryMatch>
has the same effect as
<Directory ~ >
. That is, it expects a
regular expression. So, for instance, either:
<Directory ~ /[a-d].*>
or:
<DirectoryMatch /[a-d].*>
means “any directory name in the root directory that starts with a, b, c, or d.”