]> granicus.if.org Git - apache/blobdiff - docs/manual/mod/mod_alias.xml
Quote {Alias,Redirect,ScriptAlias}{,Match} arguments.
[apache] / docs / manual / mod / mod_alias.xml
index d6572d439559a8898bf0f8a80a558e5a44d17556..37e7f71806fc61f8d550c089277caf5944ff0769 100644 (file)
@@ -89,8 +89,8 @@ href="../urlmapping.html">Mapping URLs to the filesystem</a></seealso>
     configuration will work as expected:</p>
 
     <highlight language="config">
-Alias /foo/bar /baz
-Alias /foo /gaq
+Alias "/foo/bar" "/baz"
+Alias "/foo"     "/gaq"
     </highlight>
 
     <p>But if the above two directives were reversed in order, the
@@ -131,7 +131,7 @@ Alias /foo /gaq
     file systems.</p>
 
     <highlight language="config">
-      Alias /image /ftp/pub/image
+Alias "/image" "/ftp/pub/image"
     </highlight>
 
     <p>A request for <code>http://example.com/image/foo.gif</code> would cause
@@ -146,7 +146,7 @@ Alias /foo /gaq
     order to expand the alias. That is, if you use</p>
 
     <highlight language="config">
-      Alias /icons/ /usr/local/apache/icons/
+Alias "/icons/" "/usr/local/apache/icons/"
     </highlight>
 
     <p>then the url <code>/icons</code> will not be aliased, as it lacks
@@ -169,7 +169,7 @@ Alias /foo /gaq
     permit access to the target directory.</p>
 
     <highlight language="config">
-Alias /image /ftp/pub/image
+Alias "/image" "/ftp/pub/image"
 &lt;Directory "/ftp/pub/image"&gt;
     Require all granted
 &lt;/Directory&gt;
@@ -186,10 +186,10 @@ Alias /image /ftp/pub/image
 
     <highlight language="config">
 &lt;Location "/image"&gt;
-    Alias /ftp/pub/image
+    Alias "/ftp/pub/image"
 &lt;/Location&gt;
 &lt;LocationMatch "/error/(?&lt;NUMBER&gt;[0-9]+)"&gt;
-    Alias /usr/local/apache/errors/%{env:MATCH_NUMBER}.html
+    Alias "/usr/local/apache/errors/%{env:MATCH_NUMBER}.html"
 &lt;/LocationMatch&gt;
     </highlight>
 
@@ -217,7 +217,7 @@ expressions</description>
     use:</p>
 
     <highlight language="config">
-      AliasMatch ^/icons(/|$)(.*) /usr/local/apache/icons$1$2
+AliasMatch "^/icons(/|$)(.*)" "/usr/local/apache/icons$1$2"
     </highlight>
 
     <p>The full range of <glossary ref="regex">regular expression</glossary>
@@ -226,7 +226,7 @@ expressions</description>
     matching of the URL-path:</p>
 
     <highlight language="config">
-      AliasMatch (?i)^/image(.*) /ftp/pub/image$1
+AliasMatch "(?i)^/image(.*)" "/ftp/pub/image$1"
     </highlight>
 
     <p>One subtle difference
@@ -251,20 +251,20 @@ expressions</description>
     <p>For example, suppose you want to replace this with AliasMatch:</p>
 
     <highlight language="config">
-      Alias /image/ /ftp/pub/image/
+Alias "/image/" "/ftp/pub/image/"
     </highlight>
 
     <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>
 
     <highlight language="config">
-      AliasMatch /image/ /ftp/pub/image/
+AliasMatch "/image/" "/ftp/pub/image/"
     </highlight>
 
     <p>This is what you need to get the same effect:</p>
 
     <highlight language="config">
-      AliasMatch ^/image/(.*)$ /ftp/pub/image/$1
+AliasMatch "^/image/(.*)$" "/ftp/pub/image/$1"
     </highlight>
 
     <p>Of course, there's no point in
@@ -275,8 +275,8 @@ expressions</description>
     serve different kinds of files from different directories:</p>
 
     <highlight language="config">
-      AliasMatch ^/image/(.*)\.jpg$ /files/jpg.images/$1.jpg<br/>
-      AliasMatch ^/image/(.*)\.gif$ /files/gif.images/$1.gif
+AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg"<br/>
+AliasMatch "^/image/(.*)\.gif$" "/files/gif.images/$1.gif"
     </highlight>
 
     <p>Multiple leading slashes in the requested URL are discarded
@@ -316,10 +316,10 @@ a different URL</description>
 
     <highlight language="config">
 # Redirect to a URL on a different host
-Redirect /service http://foo2.example.com/service
+Redirect "/service" "http://foo2.example.com/service"
 
 # Redirect to a URL on the same host
-Redirect /one /two
+Redirect "/one" "/two"
     </highlight>
 
     <p>If the client requests <code>http://example.com/service/foo.txt</code>,
@@ -382,8 +382,8 @@ Redirect /one /two
     <code>send_error_response</code> in http_protocol.c).</p>
 
     <highlight language="config">
-Redirect permanent /one http://example.com/two
-Redirect 303 /three http://example.com/other
+Redirect permanent "/one" "http://example.com/two"
+Redirect 303 "/three" "http://example.com/other"
     </highlight>
 
     <p>If the <directive>Redirect</directive> directive is used within a
@@ -394,13 +394,13 @@ Redirect 303 /three http://example.com/other
 
     <highlight language="config">
 &lt;Location "/one"&gt;
-    Redirect permanent http://example.com/two
+    Redirect permanent "http://example.com/two"
 &lt;/Location&gt;<br />
 &lt;Location "/three"&gt;
-    Redirect 303 http://example.com/other
+    Redirect 303 "http://example.com/other"
 &lt;/Location&gt;<br />
 &lt;LocationMatch "/error/(?&lt;NUMBER&gt;[0-9]+)"&gt;
-    Redirect permanent http://example.com/errors/%{env:MATCH_NUMBER}.html
+    Redirect permanent "http://example.com/errors/%{env:MATCH_NUMBER}.html"
 &lt;/LocationMatch&gt;<br />
     </highlight>
 
@@ -429,7 +429,7 @@ of the current URL</description>
     another server, one might use:</p>
 
     <highlight language="config">
-      RedirectMatch (.*)\.gif$ http://other.example.com$1.jpg
+RedirectMatch "(.*)\.gif$" "http://other.example.com$1.jpg"
     </highlight>
 
     <p>The considerations related to the difference between
@@ -498,15 +498,15 @@ target as a CGI script</description>
     pathname in the local filesystem.</p>
 
     <highlight language="config">
-      ScriptAlias /cgi-bin/ /web/cgi-bin/
+ScriptAlias "/cgi-bin/" "/web/cgi-bin/"
     </highlight>
 
     <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>
     <highlight language="config">
-Alias /cgi-bin/ /web/cgi-bin/
-&lt;Location "/cgi-bin" &gt;
+Alias "/cgi-bin/" "/web/cgi-bin/"
+&lt;Location "/cgi-bin"&gt;
     SetHandler cgi-script
     Options +ExecCGI
 &lt;/Location&gt;
@@ -516,8 +516,8 @@ Alias /cgi-bin/ /web/cgi-bin/
        a script or handler you have. For example:</p>
 
        <highlight language="config">
-         ScriptAlias /cgi-bin/ /web/cgi-handler.pl
-    </highlight>
+ScriptAlias "/cgi-bin/" "/web/cgi-handler.pl"
+        </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
@@ -556,10 +556,10 @@ Alias /cgi-bin/ /web/cgi-bin/
 
     <highlight language="config">
 &lt;Location "/cgi-bin"&gt;
-    ScriptAlias /web/cgi-bin/
+    ScriptAlias "/web/cgi-bin/"
 &lt;/Location&gt;
 &lt;LocationMatch "/cgi-bin/errors/(?&lt;NUMBER&gt;[0-9]+)"&gt;
-    ScriptAlias /web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi
+    ScriptAlias "/web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi"
 &lt;/LocationMatch&gt;<br />
     </highlight>
 
@@ -588,7 +588,7 @@ and designates the target as a CGI script</description>
     might use:</p>
 
     <highlight language="config">
-      ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
+ScriptAliasMatch "^/cgi-bin(.*)" "/usr/local/apache/cgi-bin$1"
     </highlight>
 
     <p>As for AliasMatch, the full range of <glossary ref="rexex">regular
@@ -597,7 +597,7 @@ and designates the target as a CGI script</description>
     matching of the URL-path:</p>
 
     <highlight language="config">
-      ScriptAliasMatch (?i)^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
+ScriptAliasMatch "(?i)^/cgi-bin(.*)" "/usr/local/apache/cgi-bin$1"
     </highlight>
 
     <p>The considerations related to the difference between