From 7896be49ddc0af6e4b342634fb203e5b57fa30e2 Mon Sep 17 00:00:00 2001 From: Joshua Slive Date: Tue, 23 Mar 2004 04:23:25 +0000 Subject: [PATCH] Clarify the order of processing in mod_alias. PR: 21897 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103094 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_alias.html.en | 36 ++++++++++++++++++++++++++++++- docs/manual/mod/mod_alias.xml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index a79fa6e7e1..78891fdce0 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -56,12 +56,46 @@
  • ScriptAlias
  • ScriptAliasMatch
  • -

    See also

    +

    Topics

    +

    See also

    +
    top
    +
    +

    Order of Processing

    + +

    Aliases and Redirects occuring in different contexts are processed +like other directives according to standard merging rules. 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. For example, the following +configuration will work as expected:

    + +

    +Alias /foo/bar /baz
    +Alias /foo /gaq +

    + +

    But if the above two directives were reversed in order, the +/foo Alias +would always match before the /foo/bar Alias, so the latter directive would be +ignored.

    +
    top

    Alias Directive

    diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml index a8cfe6bee7..7e29b4f67e 100644 --- a/docs/manual/mod/mod_alias.xml +++ b/docs/manual/mod/mod_alias.xml @@ -49,6 +49,41 @@ mod_rewriteMapping URLs to the filesystem +
    Order of Processing + +

    Aliases and Redirects occuring in different contexts are processed +like other directives according to standard merging rules. 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. For example, the following +configuration will work as expected:

    + + +Alias /foo/bar /baz
    +Alias /foo /gaq +
    + +

    But if the above two directives were reversed in order, the +/foo Alias +would always match before the /foo/bar Alias, so the latter directive would be +ignored.

    + +
    + Alias Maps URLs to filesystem locations -- 2.50.1