diff options
Diffstat (limited to 'docs/manual/mod/mod_alias.html.en')
-rw-r--r-- | docs/manual/mod/mod_alias.html.en | 93 |
1 files changed, 29 insertions, 64 deletions
diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index 3c0d53dd..4d0c8854 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -97,10 +97,8 @@ all the directives to have an effect. For example, the following configuration will work as expected:</p> - <pre class="prettyprint lang-config"> -Alias /foo/bar /baz -Alias /foo /gaq - </pre> + <pre class="prettyprint lang-config">Alias /foo/bar /baz +Alias /foo /gaq</pre> <p>But if the above two directives were reversed in order, the @@ -128,9 +126,7 @@ Alias /foo /gaq <var>URL-path</var> is case-sensitive, even on case-insensitive file systems.</p> - <pre class="prettyprint lang-config"> - Alias /image /ftp/pub/image - </pre> + <pre class="prettyprint lang-config">Alias /image /ftp/pub/image</pre> <p>A request for <code>http://example.com/image/foo.gif</code> would cause @@ -143,7 +139,8 @@ Alias /foo /gaq <var>URL-path</var> then the server will require a trailing / in order to expand the alias. That is, if you use</p> - <dl><dd><code>Alias /icons/ /usr/local/apache/icons/</code></dd></dl> + <pre class="prettyprint lang-config">Alias /icons/ /usr/local/apache/icons/</pre> + <p>then the url <code>/icons</code> will not be aliased, as it lacks that trailing /. Likewise, if you omit the slash on the @@ -162,12 +159,10 @@ Alias /foo /gaq directory outside of your <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>, you may need to explicitly permit access to the target directory.</p> - <pre class="prettyprint lang-config"> -Alias /image /ftp/pub/image + <pre class="prettyprint lang-config">Alias /image /ftp/pub/image <Directory /ftp/pub/image> Require all granted -</Directory> - </pre> +</Directory></pre> <p>Any number slashes in the <var>URL-path</var> parameter @@ -195,9 +190,7 @@ expressions</td></tr> example, to activate the <code>/icons</code> directory, one might use:</p> - <pre class="prettyprint lang-config"> - AliasMatch ^/icons(.*) /usr/local/apache/icons$1 - </pre> + <pre class="prettyprint lang-config">AliasMatch ^/icons(.*) /usr/local/apache/icons$1</pre> <p>The full range of <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a> @@ -205,9 +198,7 @@ expressions</td></tr> it is possible to construct an alias with case-insensitive matching of the URL-path:</p> - <pre class="prettyprint lang-config"> - AliasMatch (?i)^/image(.*) /ftp/pub/image$1 - </pre> + <pre class="prettyprint lang-config">AliasMatch (?i)^/image(.*) /ftp/pub/image$1</pre> <p>One subtle difference @@ -231,24 +222,18 @@ expressions</td></tr> <p>For example, suppose you want to replace this with AliasMatch:</p> - <pre class="prettyprint lang-config"> - Alias /image/ /ftp/pub/image/ - </pre> + <pre class="prettyprint lang-config">Alias /image/ /ftp/pub/image/</pre> <p>This is NOT equivalent - don't do this! This will send all requests that have /image/ anywhere in them to /ftp/pub/image/:</p> - <pre class="prettyprint lang-config"> - AliasMatch /image/ /ftp/pub/image/ - </pre> + <pre class="prettyprint lang-config">AliasMatch /image/ /ftp/pub/image/</pre> <p>This is what you need to get the same effect:</p> - <pre class="prettyprint lang-config"> - AliasMatch ^/image/(.*)$ /ftp/pub/image/$1 - </pre> + <pre class="prettyprint lang-config">AliasMatch ^/image/(.*)$ /ftp/pub/image/$1</pre> <p>Of course, there's no point in @@ -258,10 +243,8 @@ expressions</td></tr> you do more complicated things. For example, you could serve different kinds of files from different directories:</p> - <pre class="prettyprint lang-config"> - AliasMatch ^/image/(.*)\.jpg$ /files/jpg.images/$1.jpg<br /> - AliasMatch ^/image/(.*)\.gif$ /files/gif.images/$1.gif - </pre> + <pre class="prettyprint lang-config"> AliasMatch ^/image/(.*)\.jpg$ /files/jpg.images/$1.jpg<br /> + AliasMatch ^/image/(.*)\.gif$ /files/gif.images/$1.gif</pre> <p>Multiple leading slashes in the requested URL are discarded @@ -299,13 +282,11 @@ a different URL</td></tr> <em>URL</em>. Additional path information beyond the matched <em>URL-Path</em> will be appended to the target URL.</p> - <pre class="prettyprint lang-config"> -# Redirect to a URL on a different host + <pre class="prettyprint lang-config"># Redirect to a URL on a different host Redirect /service http://foo2.example.com/service # Redirect to a URL on the same host -Redirect /one /two - </pre> +Redirect /one /two</pre> <p>If the client requests <code>http://example.com/service/foo.txt</code>, @@ -363,10 +344,8 @@ Redirect /one /two HTTP status code, known to the Apache HTTP Server (see the function <code>send_error_response</code> in http_protocol.c).</p> - <pre class="prettyprint lang-config"> -Redirect permanent /one http://example.com/two -Redirect 303 /three http://example.com/other - </pre> + <pre class="prettyprint lang-config">Redirect permanent /one http://example.com/two +Redirect 303 /three http://example.com/other</pre> @@ -392,9 +371,7 @@ of the current URL</td></tr> example, to redirect all GIF files to like-named JPEG files on another server, one might use:</p> - <pre class="prettyprint lang-config"> - RedirectMatch (.*)\.gif$ http://other.example.com$1.jpg - </pre> + <pre class="prettyprint lang-config">RedirectMatch (.*)\.gif$ http://other.example.com$1.jpg</pre> <p>The considerations related to the difference between @@ -460,29 +437,23 @@ target as a CGI script</td></tr> to scripts beginning with the second argument, which is a full pathname in the local filesystem.</p> - <pre class="prettyprint lang-config"> - ScriptAlias /cgi-bin/ /web/cgi-bin/ - </pre> + <pre class="prettyprint lang-config">ScriptAlias /cgi-bin/ /web/cgi-bin/</pre> <p>A request for <code>http://example.com/cgi-bin/foo</code> would cause the server to run the script <code>/web/cgi-bin/foo</code>. This configuration is essentially equivalent to:</p> - <pre class="prettyprint lang-config"> -Alias /cgi-bin/ /web/cgi-bin/ + <pre class="prettyprint lang-config">Alias /cgi-bin/ /web/cgi-bin/ <Location /cgi-bin > SetHandler cgi-script Options +ExecCGI -</Location> - </pre> +</Location></pre> <p><code class="directive">ScriptAlias</code> can also be used in conjunction with a script or handler you have. For example:</p> - <pre class="prettyprint lang-config"> - ScriptAlias /cgi-bin/ /web/cgi-handler.pl - </pre> + <pre class="prettyprint lang-config">ScriptAlias /cgi-bin/ /web/cgi-handler.pl</pre> <p>In this scenario all files requested in <code>/cgi-bin/</code> will be @@ -499,12 +470,10 @@ Alias /cgi-bin/ /web/cgi-bin/ 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: - <pre class="prettyprint lang-config"> -<Directory /usr/local/apache2/htdocs/cgi-bin > + <pre class="prettyprint lang-config"><Directory /usr/local/apache2/htdocs/cgi-bin > SetHandler cgi-script Options ExecCGI -</Directory> - </pre> +</Directory></pre> This is necessary since multiple <var>URL-paths</var> can map to the same filesystem location, potentially bypassing the @@ -538,9 +507,7 @@ and designates the target as a CGI script</td></tr> example, to activate the standard <code>/cgi-bin</code>, one might use:</p> - <pre class="prettyprint lang-config"> - ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1 - </pre> + <pre class="prettyprint lang-config">ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1</pre> <p>As for AliasMatch, the full range of <a class="glossarylink" href="../glossary.html#rexex" title="see glossary">regular @@ -548,9 +515,7 @@ and designates the target as a CGI script</td></tr> For example, it is possible to construct an alias with case-insensitive matching of the URL-path:</p> - <pre class="prettyprint lang-config"> - ScriptAliasMatch (?i)^/cgi-bin(.*) /usr/local/apache/cgi-bin$1 - </pre> + <pre class="prettyprint lang-config">ScriptAliasMatch (?i)^/cgi-bin(.*) /usr/local/apache/cgi-bin$1</pre> <p>The considerations related to the difference between @@ -589,7 +554,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_alias.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 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 2014 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="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |