You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sl...@apache.org on 2004/03/23 05:24:11 UTC

cvs commit: httpd-2.0/docs/manual/mod mod_alias.xml mod_alias.html.en

slive       2004/03/22 20:24:11

  Modified:    docs/manual/mod Tag: APACHE_2_0_BRANCH mod_alias.xml
                        mod_alias.html.en
  Log:
  Backport:
    Clarify the order of processing in mod_alias.
  
    PR: 21897
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.9.2.8   +35 -0     httpd-2.0/docs/manual/mod/mod_alias.xml
  
  Index: mod_alias.xml
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_alias.xml,v
  retrieving revision 1.9.2.7
  retrieving revision 1.9.2.8
  diff -u -d -b -u -r1.9.2.7 -r1.9.2.8
  --- mod_alias.xml	20 Feb 2004 18:37:43 -0000	1.9.2.7
  +++ mod_alias.xml	23 Mar 2004 04:24:10 -0000	1.9.2.8
  @@ -49,6 +49,41 @@
   <seealso><module>mod_rewrite</module></seealso> <seealso><a
   href="../urlmapping.html">Mapping URLs to the filesystem</a></seealso>
   
  +<section id="order"><title>Order of Processing</title>
  +
  +<p>Aliases and Redirects occuring in different contexts are processed
  +like other directives according to standard <a
  +href="../sections.html#mergin">merging rules</a>.  But when multiple
  +Aliases or Redirects occur in the same context (for example, in the
  +same <directive type="section" module="core">VirtualHost</directive>
  +section) they are processed in a particular order.</p>
  +
  +<p>First, all Redirects are processed before Aliases are processed,
  +and therefore a request that matches a <directive
  +module="mod_alias">Redirect</directive> or <directive
  +module="mod_alias">RedirectMatch</directive> 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.</p>
  +
  +<p>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:</p>
  +
  +<example>
  +Alias /foo/bar /baz<br />
  +Alias /foo /gaq
  +</example>
  +
  +<p>But if the above two directives were reversed in order, the
  +<code>/foo</code> <directive module="mod_alias">Alias</directive>
  +would always match before the <code>/foo/bar</code> <directive
  +module="mod_alias">Alias</directive>, so the latter directive would be
  +ignored.</p>
  +
  +</section>
  +
   <directivesynopsis>
   <name>Alias</name>
   <description>Maps URLs to filesystem locations</description>
  
  
  
  1.14.2.7  +36 -2     httpd-2.0/docs/manual/mod/mod_alias.html.en
  
  Index: mod_alias.html.en
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_alias.html.en,v
  retrieving revision 1.14.2.6
  retrieving revision 1.14.2.7
  diff -u -d -b -u -r1.14.2.6 -r1.14.2.7
  --- mod_alias.html.en	21 Feb 2004 00:37:46 -0000	1.14.2.6
  +++ mod_alias.html.en	23 Mar 2004 04:24:10 -0000	1.14.2.7
  @@ -56,12 +56,46 @@
   <li><img alt="" src="../images/down.gif" /> <a href="#scriptalias">ScriptAlias</a></li>
   <li><img alt="" src="../images/down.gif" /> <a href="#scriptaliasmatch">ScriptAliasMatch</a></li>
   </ul>
  -<h3>See also</h3>
  +<h3>Topics</h3>
  +<ul id="topics">
  +<li><img alt="" src="../images/down.gif" /> <a href="#order">Order of Processing</a></li>
  +</ul><h3>See also</h3>
   <ul class="seealso">
   <li><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code></li>
   <li><a href="../urlmapping.html">Mapping URLs to the filesystem</a></li>
   </ul></div>
  +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  +<div class="section">
  +<h2><a name="order" id="order">Order of Processing</a></h2>
  +
  +<p>Aliases and Redirects occuring in different contexts are processed
  +like other directives according to standard <a href="../sections.html#mergin">merging rules</a>.  But when multiple
  +Aliases or Redirects occur in the same context (for example, in the
  +same <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
  +section) they are processed in a particular order.</p>
  +
  +<p>First, all Redirects are processed before Aliases are processed,
  +and therefore a request that matches a <code class="directive"><a href="#redirect">Redirect</a></code> or <code class="directive"><a href="#redirectmatch">RedirectMatch</a></code> 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.</p>
  +
  +<p>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:</p>
  +
  +<div class="example"><p><code>
  +Alias /foo/bar /baz<br />
  +Alias /foo /gaq
  +</code></p></div>
   
  +<p>But if the above two directives were reversed in order, the
  +<code>/foo</code> <code class="directive"><a href="#alias">Alias</a></code>
  +would always match before the <code>/foo/bar</code> <code class="directive"><a href="#alias">Alias</a></code>, so the latter directive would be
  +ignored.</p>
  +
  +</div>
   <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
   <div class="directive-section"><h2><a name="Alias" id="Alias">Alias</a> <a name="alias" id="alias">Directive</a></h2>
   <table class="directive">