or <directive type="section" module="core">LocationMatch</directive>
section, <a href="../expr.html">expression syntax</a> can be used
to manipulate the destination path or URL.
- </p>
+ </p>
<p><module>mod_alias</module> is designed to handle simple URL
manipulation tasks. For more complicated tasks such as
<directive type="section" module="core">Location</directive>
or <directive type="section" module="core">LocationMatch</directive>
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.13 and later.</p>
<highlight language="config">
<Location "/image">
serve different kinds of files from different directories:</p>
<highlight language="config">
-AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg"<br/>
+AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg"
AliasMatch "^/image/(.*)\.gif$" "/files/gif.images/$1.gif"
</highlight>
<p>If the client requests <code>http://example.com/service/foo.txt</code>,
it will be told to access
<code>http://foo2.example.com/service/foo.txt</code>
- instead. This includes requests with <code>GET</code> parameters, such as
+ instead. This includes requests with <code>GET</code> parameters, such as
<code>http://example.com/service/foo.pl?q=23&a=42</code>,
it will be redirected to
<code>http://foo2.example.com/service/foo.pl?q=23&a=42</code>.
- Note that <code>POST</code>s will be discarded.<br />
- Only complete path segments are matched, so the above
+ Note that <code>POST</code>s will be discarded.<br />
+ Only complete path segments are matched, so the above
example would not match a request for
<code>http://example.com/servicefoo.txt</code>. For more complex matching
using the <a href="../expr.html">expression syntax</a>, omit the URL-path
<directive type="section" module="core">Location</directive>
or <directive type="section" module="core">LocationMatch</directive>
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.13 and later.</p>
<highlight language="config">
<Location "/one">
Redirect permanent "http://example.com/two"
-</Location><br />
+</Location>
<Location "/three">
Redirect 303 "http://example.com/other"
-</Location><br />
+</Location>
<LocationMatch "/error/(?<NUMBER>[0-9]+)">
Redirect permanent "http://example.com/errors/%{env:MATCH_NUMBER}.html"
-</LocationMatch><br />
+</LocationMatch>
</highlight>
</usage>
</Location>
</highlight>
- <p><directive>ScriptAlias</directive> can also be used in conjunction with
- a script or handler you have. For example:</p>
+ <p><directive>ScriptAlias</directive> can also be used in conjunction with
+ a script or handler you have. For example:</p>
- <highlight language="config">
+ <highlight language="config">
ScriptAlias "/cgi-bin/" "/web/cgi-handler.pl"
- </highlight>
+ </highlight>
<p>In this scenario all files requested in <code>/cgi-bin/</code> will be
handled by the file you have configured, this allows you to use your own custom
a <directive type="section" module="core">Location</directive>
or <directive type="section" module="core">LocationMatch</directive>
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.13 and later.</p>
<highlight language="config">
<Location "/cgi-bin">
</Location>
<LocationMatch "/cgi-bin/errors/(?<NUMBER>[0-9]+)">
ScriptAlias "/web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi"
-</LocationMatch><br />
+</LocationMatch>
</highlight>
</usage>