diff options
Diffstat (limited to 'docs/manual/mod/mod_alias.html.en')
| -rw-r--r-- | docs/manual/mod/mod_alias.html.en | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index 0ac82977..d87b8703 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -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 @@ -184,6 +186,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> @@ -200,12 +210,12 @@ a different URL</td></tr> <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 (%-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> + <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> <p>Then any request beginning with <em>URL-Path</em> will return a redirect request to the client at the location of the target @@ -342,9 +352,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> @@ -352,8 +362,46 @@ 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 /> + <Location /cgi-bin ><br /> + <span class="indent"> + SetHandler cgi-script<br /> + Options +ExecCGI<br /> + </span> + </Location> + </code></p></div> + + <div class="warning">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"><Directory></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 in: + <div class="example"><p><code> + <Directory /usr/local/apache2/htdocs/cgi-bin ><br /> + <span class="indent"> + SetHandler cgi-script<br /> + Options ExecCGI<br /> + </span> + </Directory> + </code></p></div> + This is necessary since multiple <var>URL-paths</var> can map + to the same filesystem location, potentially bypassing the + <code class="directive">ScriptAlias</code> and revealing the source code + of the CGI scripts if they are not restricted by a + <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> section.</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> |
