mod_alias.html revision e0b181d3bfa99dfb992df3024b397660cb7afbe9
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi This file is generated from xml source: DO NOT EDIT
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi --><title>mod_alias- Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="/style/manual.css"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_alias</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Provides for mapping different parts of the host
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi filesystem in the document tree and for URL redirection</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module&nbsp;Identifier:</a></td><td>alias_module</td></tr></table></td></tr></table><h2>Summary</h2>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>The directives contained in this module allow for manipulation
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi and control of URLs as requests arrive at the server. The
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <a class="directive" href="#alias"><code class="directive">Alias</code></a> and <a class="directive" href="#scriptalias"><code class="directive">ScriptAlias</code></a> directives are used to
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi map between URLs and filesystem paths. This allows for content
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen which is not directly under the <a class="directive" href="core.html#documentroot"><code class="directive">DocumentRoot</code></a> served as part of the web
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen document tree. The <a class="directive" href="#scriptalias"><code class="directive">ScriptAlias</code></a> directive has the
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen additional effect of marking the target directory as containing
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen only CGI scripts.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>The <a class="directive" href="#redirect"><code class="directive">Redirect</code></a>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi directives are used to instruct clients to make a new request with
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen a different URL. They are often used when a resource has moved to
3f08db06526d6901aa08c110b5bc7dde6bc39905nd a new location.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<h2>Directives</h2><ul><li><a href="#alias">Alias</a></li><li><a href="#aliasmatch">AliasMatch</a></li><li><a href="#redirect">Redirect</a></li><li><a href="#redirectmatch">RedirectMatch</a></li><li><a href="#redirectpermanent">RedirectPermanent</a></li><li><a href="#redirecttemp">RedirectTemp</a></li><li><a href="#scriptalias">ScriptAlias</a></li><li><a href="#scriptaliasmatch">ScriptAliasMatch</a></li></ul><p><strong>See also </strong></p><ul><li><code><a href="mod_rewrite.html">mod_rewrite</a></code></li><li><a href="/urlmapping.html">Mapping URLs to the filesystem</a></li></ul><hr/><h2><a name="Alias">Alias</a> <a name="alias">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Maps URLs to filesystem locations</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td> Alias <em>URL-path
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi file-path</em>|<em>directory-path</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
3f08db06526d6901aa08c110b5bc7dde6bc39905nd <p>The <code class="directive">Alias</code> directive allows documents to
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi be stored in the local filesystem other than under the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <a class="directive" href="core.html#documentroot"><code class="directive">DocumentRoot</code></a>. URLs with a
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi (%-decoded) path beginning with <em>url-path</em> will be mapped
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi to local files beginning with <em>directory-filename</em>.</p>
11495c9f0bd33e51a25b4d532beadfbcf9b944a3nilgun
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>Example:</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>Alias /image /ftp/pub/image</code></td></tr></table></blockquote>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
645cf915f6bc22be17750bc5bb34ade8de6744dfnd <p>A request for http://myserver/image/foo.gif would cause the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi server to return the file /ftp/pub/image/foo.gif.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>Note that if you include a trailing / on the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <em>url-path</em> then the server will require a trailing / in
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi order to expand the alias. That is, if you use <code>Alias
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi /icons/ /usr/local/apache/icons/</code> then the url
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code>/icons</code> will not be aliased.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>Note that you may need to specify additional <a class="directive" href="core.html#<directory>"><code class="directive">&lt;Directory&gt;</code></a> sections which cover
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the <em>destination</em> of aliases. Aliasing occurs before
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <a class="directive" href="core.html#<directory>"><code class="directive">&lt;Directory&gt;</code></a> sections
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi are checked, so only the destination of aliases are affected.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi (Note however <a class="directive" href="core.html#<location>"><code class="directive">&lt;Location&gt;</code></a>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi sections are run through once before aliases are performed, so
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi they will apply.)</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<hr/><h2><a name="AliasMatch">AliasMatch</a> <a name="aliasmatch">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Maps URLs to filesystem locations using regular
1d980e5489836e977ba59b419e27b0ec875c4bd3takashiexpressions</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>AliasMatch <em>regex
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi file-path</em>|<em>directory-path</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>This directive is equivalent to <a class="directive" href="#alias"><code class="directive">Alias</code></a>, but makes use of standard
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi regular expressions, instead of simple prefix matching. The
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi supplied regular expression is matched against the URL-path, and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi if it matches, the server will substitute any parenthesized
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi matches into the given string and use it as a filename. For
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi example, to activate the <code>/icons</code> directory, one might
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi use:</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi AliasMatch ^/icons(.*) /usr/local/apache/icons$1
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi</code></td></tr></table></blockquote>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<hr/><h2><a name="Redirect">Redirect</a> <a name="redirect">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sends an external redirect asking the client to fetch
1d980e5489836e977ba59b419e27b0ec875c4bd3takashia different URL</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>Redirect [<em>status</em>] <em>URL-path URL</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>The Redirect directive maps an old URL into a new one. The
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun new URL is returned to the client which attempts to fetch it
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi again with the new address. <em>URL-path</em> a (%-decoded)
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi path; any requests for documents beginning with this path will
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi be returned a redirect error to a new (%-encoded) URL beginning
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi with <em>URL</em>.</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>Example:</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>Redirect /service http://foo2.bar.com/service</code></td></tr></table></blockquote>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>If the client requests http://myserver/service/foo.txt, it
b9f522ae1c0ed2bf3fc4444245bf28b2e2449a65nd will be told to access http://foo2.bar.com/service/foo.txt
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi instead.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<blockquote><table><tr><td bgcolor="#e0e5f5"><p align="center"><strong>Note</strong></p> <p>Redirect directives take precedence over
1d980e5489836e977ba59b419e27b0ec875c4bd3takashiAlias and ScriptAlias directives, irrespective of their ordering in
1d980e5489836e977ba59b419e27b0ec875c4bd3takashithe configuration file. Also, <em>URL-path</em> must be an absolute
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgunpath, not a relative path, even when used with .htaccess files or
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohinside of <a class="directive" href="core.html#<directory>"><code class="directive">&lt;Directory&gt;</code></a>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashisections.</p></td></tr></table></blockquote>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>If no <em>status</em> argument is given, the redirect will
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi be "temporary" (HTTP status 302). This indicates to the client
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi that the resource has moved temporarily. The <em>status</em>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun argument can be used to return other HTTP status codes:</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dl>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dt>permanent</dt>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dd>Returns a permanent redirect status (301) indicating that
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the resource has moved permanently.</dd>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dt>temp</dt>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dd>Returns a temporary redirect status (302). This is the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi default.</dd>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dt>seeother</dt>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dd>Returns a "See Other" status (303) indicating that the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi resource has been replaced.</dd>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dt>gone</dt>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <dd>Returns a "Gone" status (410) indicating that the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi resource has been permanently removed. When this status is
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi used the <em>url</em> argument should be omitted.</dd>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi </dl>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>Other status codes can be returned by giving the numeric
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi status code as the value of <em>status</em>. If the status is
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi between 300 and 399, the <em>url</em> argument must be present,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi otherwise it must be omitted. Note that the status must be
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi known to the Apache code (see the function
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code>send_error_response</code> in http_protocol.c).</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>Example:</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun Redirect permanent /one http://example.com/two<br/>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun Redirect 303 /three http://example.com/other
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun </code></td></tr></table></blockquote>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<hr/><h2><a name="RedirectMatch">RedirectMatch</a> <a name="redirectmatch">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sends an external redirect asking the client to fetch
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilguna different URL based on a regular expression match of the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashicurrent URL</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>RedirectMatch [<em>status</em>] <em>regex URL</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>This directive is equivalent to <a class="directive" href="#redirect"><code class="directive">Redirect</code></a>, but makes use of standard
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi regular expressions, instead of simple prefix matching. The
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi supplied regular expression is matched against the URL-path, and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi if it matches, the server will substitute any parenthesized
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi matches into the given string and use it as a filename. For
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun example, to redirect all GIF files to like-named JPEG files on
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun another server, one might use:</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun</code></td></tr></table></blockquote>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<hr/><h2><a name="RedirectPermanent">RedirectPermanent</a> <a name="redirectpermanent">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sends an external permanent redirect asking the client to fetch
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilguna different URL</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>RedirectPermanent <em>URL-path URL</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>This directive makes the client know that the Redirect is
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun permanent (status 301). Exactly equivalent to <code>Redirect
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun permanent</code>.</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<hr/><h2><a name="RedirectTemp">RedirectTemp</a> <a name="redirecttemp">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Sends an external temporary redirect asking the client to fetch
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilguna different URL</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>RedirectTemp <em>URL-path URL</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td><a class="help" href="directive-dict.html#Override">Override:</a></td><td>FileInfo</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>This directive makes the client know that the Redirect is
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun only temporary (status 302). Exactly equivalent to
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <code>Redirect temp</code>.</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<hr/><h2><a name="ScriptAlias">ScriptAlias</a> <a name="scriptalias">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Maps a URL to a filesystem location and designates the
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilguntarget as a CGI script</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>ScriptAlias
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<em>URL-path file-path</em>|<em>directory-path</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>The <code class="directive">ScriptAlias</code> directive has the same
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun behavior as the <a class="directive" href="#alias"><code class="directive">Alias</code></a>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun directive, except that in addition it marks the target directory
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun as containing CGI scripts that will be processed by <code><a href="mod_cgi.html">mod_cgi</a></code>'s cgi-script handler. URLs with a
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun (%-decoded) path beginning with <em>URL-path</em> will be mapped
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun to scripts beginning with the second argument which is a full
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun pathname in the local filesystem.</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun <p>Example:</p>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>ScriptAlias /cgi-bin/ /web/cgi-bin/</code></td></tr></table></blockquote>
b2a930a0c94e9fd25f8d2b3a2c53573235db3f06nilgun
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>A request for <code>http://myserver/cgi-bin/foo</code> would cause the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi server to run the script <code>/web/cgi-bin/foo</code>.</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<hr/><h2><a name="ScriptAliasMatch">ScriptAliasMatch</a> <a name="scriptaliasmatch">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Maps a URL to a filesystem location using a regular expression
1d980e5489836e977ba59b419e27b0ec875c4bd3takashiand designates the target as a CGI script</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>ScriptAliasMatch
11495c9f0bd33e51a25b4d532beadfbcf9b944a3nilgun<em>regex file-path</em>|<em>directory-path</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Base</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_alias</td></tr></table></td></tr></table>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <p>This directive is equivalent to <a class="directive" href="#scriptalias"><code class="directive">ScriptAlias</code></a>, but makes use of standard
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi regular expressions, instead of simple prefix matching. The
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung supplied regular expression is matched against the URL-path,
727872d18412fc021f03969b8641810d8896820bhumbedooh and if it matches, the server will substitute any parenthesized
0d0ba3a410038e179b695446bb149cce6264e0abnd matches into the given string and use it as a filename. For
727872d18412fc021f03969b8641810d8896820bhumbedooh example, to activate the standard <code>/cgi-bin</code>, one
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh might use:</p>
0d0ba3a410038e179b695446bb149cce6264e0abnd<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
727872d18412fc021f03969b8641810d8896820bhumbedooh</code></td></tr></table></blockquote>
0d0ba3a410038e179b695446bb149cce6264e0abnd<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></body></html>