or <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code>
section, <a href="../expr.html">expression syntax</a> can be used
to manipulate the destination path or URL.
- </p>
+ </p>
<p><code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code> is designed to handle simple URL
manipulation tasks. For more complicated tasks such as
<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>
+
<p>When the <code class="directive"><a href="#alias">Alias</a></code>,
<code class="directive"><a href="#scriptalias">ScriptAlias</a></code> and
<code class="directive"><a href="#redirect">Redirect</a></code> directives are used
<p>Any number slashes in the <var>URL-path</var> parameter
matches any number of slashes in the requested URL-path.</p>
+
<p>If the <code class="directive">Alias</code> directive is used within a
<code class="directive"><a href="../mod/core.html#location"><Location></a></code>
or <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code>
section the URL-path is omitted, and the file-path is interpreted
- using <a href="../expr.html">expression syntax</a>.</p>
+ using <a href="../expr.html">expression syntax</a>.<br />
+ This syntax is available in Apache 2.4.19 and later.</p>
- <pre class="prettyprint lang-config"><Location /image>
- Alias /ftp/pub/image
+ <pre class="prettyprint lang-config"><Location "/image">
+ Alias "/ftp/pub/image"
</Location>
-<LocationMatch /error/(?<NUMBER>[0-9]+)>
- Alias /usr/local/apache/errors/%{env:MATCH_NUMBER}.html
+<LocationMatch "/error/(?<NUMBER>[0-9]+)">
+ Alias "/usr/local/apache/errors/%{env:MATCH_NUMBER}.html"
</LocationMatch></pre>
<pre class="prettyprint lang-config">Redirect permanent "/one" "http://example.com/two"
Redirect 303 "/three" "http://example.com/other"</pre>
+
<p>If the <code class="directive">Redirect</code> directive is used within a
<code class="directive"><a href="../mod/core.html#location"><Location></a></code>
or <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code>
section with the URL-path omitted, then the URL parameter will be
- interpreted using <a href="../expr.html">expression syntax</a>.</p>
+ interpreted using <a href="../expr.html">expression syntax</a>.<br />
+ This syntax is available in Apache 2.4.19 and later.</p>
- <pre class="prettyprint lang-config"><Location /one>
- Redirect permanent http://example.com/two
-</Location><br />
-<Location /three>
- Redirect 303 http://example.com/other
-</Location><br />
-<LocationMatch /error/(?<NUMBER>[0-9]+)>
- Redirect permanent http://example.com/errors/%{env:MATCH_NUMBER}.html
-</LocationMatch><br />
- </pre>
+ <pre class="prettyprint lang-config"><Location "/one">
+ Redirect permanent "http://example.com/two"
+</Location>
+<Location "/three">
+ Redirect 303 "http://example.com/other"
+</Location>
+<LocationMatch "/error/(?<NUMBER>[0-9]+)">
+ Redirect permanent "http://example.com/errors/%{env:MATCH_NUMBER}.html"
+</LocationMatch></pre>
details.</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="RedirectPermanent" id="RedirectPermanent">RedirectPermanent</a> <a name="redirectpermanent" id="redirectpermanent">Directive</a></h2>
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/"
-<Location "/cgi-bin" >
+<Location "/cgi-bin">
SetHandler cgi-script
Options +ExecCGI
</Location></pre>
<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>
+
<p>If the <code class="directive">ScriptAlias</code> directive is used within
a <code class="directive"><a href="../mod/core.html#location"><Location></a></code>
or <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code>
section with the URL-path omitted, then the URL parameter will be
- interpreted using <a href="../expr.html">expression syntax</a>.</p>
+ interpreted using <a href="../expr.html">expression syntax</a>.<br />
+ This syntax is available in Apache 2.4.19 and later.</p>
- <pre class="prettyprint lang-config"><Location /cgi-bin >
- ScriptAlias /web/cgi-bin/
+ <pre class="prettyprint lang-config"><Location "/cgi-bin">
+ ScriptAlias "/web/cgi-bin/"
</Location>
-<LocationMatch /cgi-bin/errors/(?<NUMBER>[0-9]+)>
- ScriptAlias /web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi
-</LocationMatch><br />
- </pre>
+<LocationMatch "/cgi-bin/errors/(?<NUMBER>[0-9]+)">
+ ScriptAlias "/web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi"
+</LocationMatch></pre>