Commit 19686770 authored by Joshua Slive's avatar Joshua Slive
Browse files

Backport:

Make it clear that url-path is always case-sensitive.
Provide an example of using a regex to make it case-insensitive.
Make it clear that ScriptAlias is only used when you want
BOTH mapping and script-designation.

(Plus the description of Redirect)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@432999 13f79535-47bb-0310-9956-ffa450edef68
parent 8be5a0ff
Loading
Loading
Loading
Loading
+50 −11
Original line number Diff line number Diff line
@@ -118,7 +118,9 @@ ignored.</p>
    be stored in the local filesystem other than under the 
    <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>. URLs with a
    (%-decoded) path beginning with <var>url-path</var> will be mapped
    to local files beginning with <var>directory-path</var>.</p>
    to local files beginning with <var>directory-path</var>.  The 
    <var>url-path</var> is case-sensitive, even on case-insenitive 
    file systems.</p>

    <div class="example"><h3>Example:</h3><p><code>
      Alias /image /ftp/pub/image
@@ -180,6 +182,14 @@ expressions</td></tr>
      AliasMatch ^/icons(.*) /usr/local/apache/icons$1
    </code></p></div>

    <p>It is also possible to construct an alias with case-insensitive
    matching of the url-path:</p>

    <div class="example"><p><code>
      AliasMatch (?i)^/image(.*) /ftp/pub/image$1
    </code></p></div>


</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="Redirect" id="Redirect">Redirect</a> <a name="redirect" id="redirect">Directive</a></h2>
@@ -193,12 +203,15 @@ a different URL</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
</table>
    <p>The Redirect directive maps an old URL into a new one. The
    new URL is returned to the client which attempts to fetch it
    again with the new address. <var>URL-path</var> a (%-decoded)
    path; any requests for documents beginning with this path will
    be returned a redirect error to a new (%-encoded) URL beginning
    with <var>URL</var>.</p>
    <p>The Redirect directive maps an old URL into a new one by asking
    the client to refetch the resource at the new location.</p>
  
    <p>The old <em>URL-path</em> is a case-sensitive (%-decoded) path
    beginning with a slash.  A relative path is not allowed.  The new
    <em>URL</em> should be an absolute URL beginning with a scheme and
    hostname, but a URL-path beginning with a slash may also be used,
    in which case the scheme and hostname of the current server will
    be added.</p>

    <div class="example"><h3>Example:</h3><p><code>
      Redirect /service http://foo2.bar.com/service
@@ -328,9 +341,9 @@ target as a CGI script</td></tr>
    <p>The <code class="directive">ScriptAlias</code> directive has the same
    behavior as the <code class="directive"><a href="#alias">Alias</a></code>
    directive, except that in addition it marks the target directory
    as containing CGI scripts that will be processed by <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>'s cgi-script handler. URLs with a
    as containing CGI scripts that will be processed by <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>'s cgi-script handler. URLs with a case-sensitive
    (%-decoded) path beginning with <var>URL-path</var> will be mapped
    to scripts beginning with the second argument which is a full
    to scripts beginning with the second argument, which is a full
    pathname in the local filesystem.</p>

    <div class="example"><h3>Example:</h3><p><code>
@@ -338,8 +351,34 @@ target as a CGI script</td></tr>
    </code></p></div>

    <p>A request for <code>http://myserver/cgi-bin/foo</code> would cause the
    server to run the script <code>/web/cgi-bin/foo</code>.</p>
    server to run the script <code>/web/cgi-bin/foo</code>.  This configuration
    is essentially equivalent to:</p>
    <div class="example"><p><code>
      Alias /cgi-bin/ /web/cgi-bin/<br />
      &lt;Directory /web/cgi-bin &gt;<br />
      <span class="indent">
      SetHandler cgi-script<br />
      Options +ExecCGI<br />
      </span>
      &lt;/Directory&gt;
    </code></p></div>

    <div class="note">It is safer to avoid placing CGI scripts under the
    <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> in order to
    avoid accidentally revealing their source code if the
    configuration is ever changed.  The
    <code class="directive">ScriptAlias</code> makes this easy by mapping a
    URL and designating CGI scripts at the same time.  If you do
    choose to place your CGI scripts in a directory already
    accessible from the web, do not use
    <code class="directive">ScriptAlias</code>.  Instead, use <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code>, <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code>, and <code class="directive"><a href="../mod/core.html#options">Options</a></code> as shown in the second example
    above.</div>


<h3>See also</h3>
<ul>
<li><a href="../howto/cgi.html">CGI Tutorial</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ScriptAliasMatch" id="ScriptAliasMatch">ScriptAliasMatch</a> <a name="scriptaliasmatch" id="scriptaliasmatch">Directive</a></h2>
@@ -371,6 +410,6 @@ and designates the target as a CGI script</td></tr>
<a href="../ja/mod/mod_alias.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
<a href="../ko/mod/mod_alias.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Copyright 2006 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="apache">Copyright 1995-2005 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
</body></html>
 No newline at end of file
+49 −10
Original line number Diff line number Diff line
@@ -106,7 +106,9 @@ ignored.</p>
    be stored in the local filesystem other than under the 
    <directive module="core">DocumentRoot</directive>. URLs with a
    (%-decoded) path beginning with <var>url-path</var> will be mapped
    to local files beginning with <var>directory-path</var>.</p>
    to local files beginning with <var>directory-path</var>.  The 
    <var>url-path</var> is case-sensitive, even on case-insenitive 
    file systems.</p>

    <example><title>Example:</title>
      Alias /image /ftp/pub/image
@@ -170,6 +172,14 @@ expressions</description>
    <example>
      AliasMatch ^/icons(.*) /usr/local/apache/icons$1
    </example>

    <p>It is also possible to construct an alias with case-insensitive
    matching of the url-path:</p>

    <example>
      AliasMatch (?i)^/image(.*) /ftp/pub/image$1
    </example>

</usage>
</directivesynopsis>

@@ -184,12 +194,15 @@ a different URL</description>
<override>FileInfo</override>

<usage>
    <p>The Redirect directive maps an old URL into a new one. The
    new URL is returned to the client which attempts to fetch it
    again with the new address. <var>URL-path</var> a (%-decoded)
    path; any requests for documents beginning with this path will
    be returned a redirect error to a new (%-encoded) URL beginning
    with <var>URL</var>.</p>
    <p>The Redirect directive maps an old URL into a new one by asking
    the client to refetch the resource at the new location.</p>
  
    <p>The old <em>URL-path</em> is a case-sensitive (%-decoded) path
    beginning with a slash.  A relative path is not allowed.  The new
    <em>URL</em> should be an absolute URL beginning with a scheme and
    hostname, but a URL-path beginning with a slash may also be used,
    in which case the scheme and hostname of the current server will
    be added.</p>

    <example><title>Example:</title>
      Redirect /service http://foo2.bar.com/service
@@ -321,9 +334,9 @@ target as a CGI script</description>
    behavior as the <directive module="mod_alias">Alias</directive>
    directive, except that in addition it marks the target directory
    as containing CGI scripts that will be processed by <module
    >mod_cgi</module>'s cgi-script handler. URLs with a
    >mod_cgi</module>'s cgi-script handler. URLs with a case-sensitive
    (%-decoded) path beginning with <var>URL-path</var> will be mapped
    to scripts beginning with the second argument which is a full
    to scripts beginning with the second argument, which is a full
    pathname in the local filesystem.</p>

    <example><title>Example:</title>
@@ -331,8 +344,34 @@ target as a CGI script</description>
    </example>

    <p>A request for <code>http://myserver/cgi-bin/foo</code> would cause the
    server to run the script <code>/web/cgi-bin/foo</code>.</p>
    server to run the script <code>/web/cgi-bin/foo</code>.  This configuration
    is essentially equivalent to:</p>
    <example>
      Alias /cgi-bin/ /web/cgi-bin/<br />
      &lt;Directory /web/cgi-bin &gt;<br />
      <indent>
      SetHandler cgi-script<br />
      Options +ExecCGI<br />
      </indent>
      &lt;/Directory&gt;
    </example>

    <note>It is safer to avoid placing CGI scripts under the
    <directive module="core">DocumentRoot</directive> in order to
    avoid accidentally revealing their source code if the
    configuration is ever changed.  The
    <directive>ScriptAlias</directive> makes this easy by mapping a
    URL and designating CGI scripts at the same time.  If you do
    choose to place your CGI scripts in a directory already
    accessible from the web, do not use
    <directive>ScriptAlias</directive>.  Instead, use <directive
    module="core" type="section">Directory</directive>, <directive
    module="core">SetHandler</directive>, and <directive
    module="core">Options</directive> as shown in the second example
    above.</note>

</usage>
<seealso><a href="../howto/cgi.html">CGI Tutorial</a></seealso>
</directivesynopsis>

<directivesynopsis>