From: Jim Jagielski <LocationMatch>
section, expression syntax can be used
to manipulate the destination path or URL.
-
mod_alias
is designed to handle simple URL
manipulation tasks. For more complicated tasks such as
@@ -193,7 +193,8 @@ Alias "/foo" "/gaq"
<Location>
or <LocationMatch>
section the URL-path is omitted, and the file-path is interpreted
- using expression syntax.
<Location "/image"> Alias "/ftp/pub/image" @@ -278,8 +279,8 @@ expressions you do more complicated things. For example, you could serve different kinds of files from different directories: -AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg"+
- AliasMatch "^/image/(.*)\.gif$" "/files/gif.images/$1.gif"AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg" +AliasMatch "^/image/(.*)\.gif$" "/files/gif.images/$1.gif"Multiple leading slashes in the requested URL are discarded @@ -327,12 +328,12 @@ Redirect "/one" "/two"
If the client requests http://example.com/service/foo.txt
,
it will be told to access
http://foo2.example.com/service/foo.txt
- instead. This includes requests with GET
parameters, such as
+ instead. This includes requests with GET
parameters, such as
http://example.com/service/foo.pl?q=23&a=42
,
it will be redirected to
http://foo2.example.com/service/foo.pl?q=23&a=42
.
- Note that POST
s will be discarded.
- Only complete path segments are matched, so the above
+ Note that POST
s will be discarded.
+ Only complete path segments are matched, so the above
example would not match a request for
http://example.com/servicefoo.txt
. For more complex matching
using the expression syntax, omit the URL-path
@@ -390,18 +391,18 @@ Redirect 303 "/three" "http://example.com/other"
<Location>
or <LocationMatch>
section with the URL-path omitted, then the URL parameter will be
- interpreted using expression syntax.
<Location "/one"> Redirect permanent "http://example.com/two" -</Location>+</LocationMatch> @@ -506,10 +507,10 @@ target as a CGI script </Location> -
+</Location> <Location "/three"> Redirect 303 "http://example.com/other" -</Location>
+</Location> <LocationMatch "/error/(?<NUMBER>[0-9]+)"> Redirect permanent "http://example.com/errors/%{env:MATCH_NUMBER}.html" -</LocationMatch>
-
ScriptAlias
can also be used in conjunction with
- a script or handler you have. For example:
ScriptAlias
can also be used in conjunction with
+ a script or handler you have. For example:
ScriptAlias "/cgi-bin/" "/web/cgi-handler.pl"+
ScriptAlias "/cgi-bin/" "/web/cgi-handler.pl"
In this scenario all files requested in /cgi-bin/
will be
@@ -541,15 +542,15 @@ target as a CGI script
a <Location>
or <LocationMatch>
section with the URL-path omitted, then the URL parameter will be
- interpreted using expression syntax.
<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>+</LocationMatch> diff --git a/docs/manual/mod/mod_alias.html.fr b/docs/manual/mod/mod_alias.html.fr index 5ac07c89811..3d2857e7a23 100644 --- a/docs/manual/mod/mod_alias.html.fr +++ b/docs/manual/mod/mod_alias.html.fr @@ -32,6 +32,8 @@ ko | tr +
-
Description: | Permet d'atteindre différentes parties du système de fichiers depuis l'arborescence des documents du site web, ainsi que la redirection d'URL |
---|