Context and processing order
The following context specifiers are used in this documentation:
server config
This indicates that directive can be used in global httpd.conf configuration
file but not within any section like <VirtualHost> or <Directory>.
It is not allowed in .htaccess files at all.
virtual host
This means directive may appear inside <VirtualHost>
containers.
directory
This mark indicates directive is valid inside <Directory>,
<Location>, <Files> containers and
their regular expression equivalents.
.htaccess
Directive marked with this context can appear inside per-directory .htaccess
files. Remember when RewriteRule directive is used inside .htaccess
configuration files it will automatically strip the local directory prefix
from the path and apply rules only to the remainder. You can use RewriteBase
directive to explicitly specify a base path for the rules.
Application order
While directives within one section always apply simulteneously, it is important
to understand the order of application of each section because it may have effect
on a final result. So the order of application is as follows:
- <Directory> (except regular expressions). Multiple <Directory>
sections can be applied to a single request. If multiple (non-regular expression)
<Directory> sections match the directory (or one of its parents) containing
a document, then the directives are applied in the order of shortest match
first.
- .htaccess files are applied from parent to descendant.
- <Files> and <FilesMatch> are executed simultaneously.
- <Location> and <LocationMatch> are executed simultaneously.
Sections and directives inside <VirtualHost> sections are applied after
the corresponding sections and directives outside the virtual host definition.
Only one <VirtualHost> section can apply to request at a time. Later sections
override earlier ones.