<!--%hypertext -->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Apache module mod_alias</TITLE>
</HEAD>

<BODY>
<IMG SRC="../images/apache_sub.gif" ALT="">
<!--/%hypertext -->
<H1>Module mod_alias</h1>

This module is contained in the <code>mod_alias.c</code> file, and
is compiled in by default. It provides for mapping different parts of the
host filesystem in the the document tree, and for URL redirection.

<!--%hypertext -->
<menu>
<li><A HREF="#alias">Alias</A>
<li><A HREF="#redirect">Redirect</A>
<li><A HREF="#scriptalias">ScriptAlias</A>
</menu>
<hr>
<!--/%hypertext -->

<A name="alias"><h2>Alias</h2></A>
<!--%plaintext &lt;?INDEX {\tt Alias} directive&gt; -->
<strong>Syntax:</strong> Alias <em>url-path directory-filename</em><br>
<Strong>Context:</strong> server config, virtual host<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_alias<p>

The Alias directive allows documents to be stored in the local filesystem
other than under the <A HREF="core.html#documentroot">DocumentRoot</A>.
URLs with a (%-decoded) path beginning with <em>url-path</em> will be
mapped to local files beginning with <em>directory-filename</em>.
Example:
<blockquote><code>Alias /image /ftp/pub/image</code></blockquote>
A request for http://myserver/images/foo.gif would cause the server to
return the file /ftp/pub/images/foo.gif.<p>
See also <A HREF="#scriptalias">ScriptAlias</A>.<p><hr>

<A name="redirect"><h2>Redirect</h2></A>
<!--%plaintext &lt;?INDEX {\tt Redirect} directive&gt; -->
<strong>Syntax:</strong> Redirect <em>url-path url</em><br>
<Strong>Context:</strong> server config, virtual host<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_alias<p>

The Redirect directive maps an old URL into a new one. The new URL is returned
to the client which attempts to fetch it again with the new address.
<em>Url-path</em> a (%-decoded) path; any requests for documents beginning with
this path will be returned a redirect error to a new (%-encoded) url
beginning with <em>url</em>. Example:
<blockquote><code>Redirect /service
http://foo2.bar.com/service</code></blockquote>
If the client requests http://myserver/service/foo.txt, it will be told to
access http://foo2.bar.com/service/foo.txt instead.<p>
Note: Redirect directives take precedence over Alias and ScriptAlias
directives, irrespective of their ordering in the configuration file.<p><hr>

<A name="scriptalias"><h2>ScriptAlias</h2></A>
<!--%plaintext &lt;?INDEX {\tt ScriptAlias} directive&gt; -->
<strong>Syntax:</strong> ScriptAlias <em>url-path directory-filename</em><br>
<Strong>Context:</strong> server config, virtual host<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_alias<p>

The ScriptAlias directive has the same behaviour as the
<A HREF="#alias">Alias</A> directive, except that in addition it
marks the target directory as containing CGI scripts.
URLs with a (%-decoded) path beginning with <em>url-path</em> will be
mapped to scripts beginning with <em>directory-filename</em>.
Example:
<blockquote><code>ScriptAlias /cgi-bin/ /web/cgi-bin/</code></blockquote>
A request for http://myserver/images/foo would cause the server to
run the script /web/cgi-bin/foo.<p>

<!--%hypertext -->
<hr>

<A HREF="../"><IMG SRC="../images/apache_home.gif" ALT="Home"></A>
<A HREF="./"><IMG SRC="../images/apache_index.gif" ALT="Index"></A>

</BODY>
</HTML>
<!--/%hypertext -->
