<Directory> directive

Description: Group directives that will be applied to specific file-system directory and sub-directories
Syntax: <Directory directory-path> ... </Directory>
Context: server config, virtual host

 

<Directory> ... </Directory> tag is used to group directives that will apply to specific file-system directory and sub-directories. Wildcard characters ? and * are allowed. Regular expressions can also be used with the addition of the ~ character.

Be careful with the directory-path arguments: They have to literally match the filesystem path which is used to access files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links. Only fully qualified file paths are allowed.

Example:

<Directory C:/inetpub/>
   AllowOverride None
</Directory>

<Directory C:/inetpub/home/>
   AllowOverride FileInfo
</Directory>

<Directory ~ "C:/inetpub/wwwroot/.*/[0-9]{3}">
   # ... directives here ...
</Directory>

 

Don't forget to include RewriteEngine on directive in every <VirtualHost> tag or enclosed rules will not be applied.