Order of processing of Apache URI modifications
Apache web server directives are processed according to Apache’s merging rules (Directory, Files, Location, etc).
But when multiple Aliases or Redirects occur in the same context (for example, in the same <VirtualHost>
section) they are processed in a particular order.
First, all Redirects are processed before Aliases are processed, and therefore a request that matches a Redirect
or RedirectMatch
will never have Aliases applied.
Second, the Aliases and Redirects are processed in the order they appear in the configuration files, with the first match taking precedence.
For this reason, when two or more of these directives apply to the same sub-path, you must list the most specific path first in order for all the directives to have an effect.
- Source: mod_alias documentation
When modifying URIs, you may also want or need to use mod_rewrite:
Comments are closed
Comments to this thread have been closed by the post author or by an administrator.