2685N/A<!
DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
100N/A<
TITLE>Apache module mod_alias</
TITLE>
100N/A<
H1>Module mod_alias</
h1>
100N/Ais compiled in by default. It provides for mapping different parts of the
100N/Ahost filesystem in the the document tree, and for URL redirection.
1472N/A<
li><
A HREF="#alias">Alias</
A>
1472N/A<
li><
A HREF="#redirect">Redirect</
A>
1472N/A<
li><
A HREF="#redirecttemp">RedirectTemp</
A>
100N/A<
li><
A HREF="#redirectperm">RedirectPermanent</
A>
100N/A<
li><
A HREF="#scriptalias">ScriptAlias</
A>
100N/A<
A name="alias"><
h2>Alias</
h2></
A>
100N/A<!--%plaintext <?INDEX {\tt Alias} directive> --> 100N/A<
strong>Syntax:</
strong> Alias <
em>url-path directory-filename</
em><
br>
100N/A<
Strong>Context:</
strong> server config, virtual host<
br>
100N/A<
strong>Status:</
strong> Base<
br>
100N/A<
strong>Module:</
strong> mod_alias<
br>
100N/AThe Alias directive allows documents to be stored in the local filesystem
720N/Aother than under the <
A HREF="core.html#documentroot">DocumentRoot</
A>.
720N/AURLs with a (%-decoded) path beginning with <
em>url-path</
em> will be
720N/Amapped to local files beginning with <
em>directory-filename</
em>.
720N/ASee also <
A HREF="#scriptalias">ScriptAlias</
A>.<
p><
hr>
720N/A<
A name="redirect"><
h2>Redirect</
h2></
A>
720N/A<!--%plaintext <?INDEX {\tt Redirect} directive> --> 720N/A<
strong>Syntax:</
strong> Redirect [ <
em>status</
em> ] <
em>url-path url</
em><
br>
720N/A<
Strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
720N/A<
strong>Status:</
strong> Base<
br>
720N/A<
strong>Module:</
strong> mod_alias<
br>
100N/A<
strong>Compatibility:</
strong> The directory and .htaccess context's
720N/Aare only available in versions 1.1 and later. The <
em>status</
em> argument is only available in Apache 1.2 or later.<
p>
720N/AThe Redirect directive maps an old URL into a new one. The new URL is returned
720N/Ato the client which attempts to fetch it again with the new address.
720N/A<
em>Url-path</
em> a (%-decoded) path; any requests for documents beginning with
720N/Athis path will be returned a redirect error to a new (%-encoded) url
720N/Abeginning with <
em>url</
em>. Example:
720N/A<
blockquote><
code>Redirect /service
720N/ANote: Redirect directives take precedence over Alias and ScriptAlias
720N/Adirectives, irrespective of their ordering in the configuration file. Also,
720N/A<
em>Url-path</
em> must be an absolute path, not a relative path, even when used with
720N/A.htaccess files or inside of <Directory> sections.<
p>
720N/AIf no <
em>status</
em> argument is given, the redirect will be
720N/A"temporary" (HTTP status 302). This indicates to the client that the
100N/Aresources is has moved temporarily. The <
em>status</
em>
720N/Aargument can be used to return other HTTP status codes:
720N/A<
dt>permanent<
dd>Returns a permanent redirect status (301) indicating that
100N/Athe resource has moved permanently.
100N/A<
dt>temp<
dd>Returns a temporary redirect status (302). This is the
720N/A<
dt>seeother<
dd>Returns a "See Other" status (303) indicating that
2619N/Athe resource has been replaced.
2619N/A<
dt>gone<
dd>Returns a "Gone" status (410) indicating that the resource
2619N/Ahas been permanently removed. When this status is used the <
em>url</
em>
2619N/AOther status codes can be returned by giving the numeric status code
2619N/Aas the value of <
em>status</
em>. If the status is between 300 and 399,
2619N/Athe <
em>url</
em> argument must be present, otherwise it must be
2619N/Aomitted. Note that the status must be known to the Apache code (see
720N/A<
A name="redirecttemp"><
h2>RedirectTemp</
h2></
A>
720N/A<!--%plaintext <?INDEX {\tt Redirect} directive> --> 100N/A<
strong>Syntax:</
strong> RedirectTemp <
em>url-path url</
em><
br>
100N/A<
Strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
100N/A<
strong>Status:</
strong> Base<
br>
100N/A<
strong>Module:</
strong> mod_alias<
br>
100N/A<
strong>Compatibility:</
strong> This directive is only available in 1.2<
P>
This directive makes the client know that the Redirect is only
temporary. (Status 302). Exactly equivalent to <
code>Redirect temporary </
code><
P>
<
A name="redirectperm"><
h2>RedirectPermanent</
h2></
A>
<!--%plaintext <?INDEX {\tt Redirect} directive> --> <
strong>Syntax:</
strong> RedirectPermanent <
em>url-path url</
em><
br>
<
Strong>Context:</
strong> server config, virtual host, directory, .htaccess<
br>
<
strong>Status:</
strong> Base<
br>
<
strong>Module:</
strong> mod_alias<
br>
<
strong>Compatibility:</
strong> This directive is only available in 1.2<
P>
This directive makes the client know that the Redirect is permanent.
(Status 301). Exactly equivalent to <
code>Redirect permanent</
code><
P>
<
A name="scriptalias"><
h2>ScriptAlias</
h2></
A>
<!--%plaintext <?INDEX {\tt ScriptAlias} directive> --> <
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<
br>
The ScriptAlias directive has the same behavior 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>.
<
blockquote><
code>ScriptAlias /cgi-bin/ /
web/
cgi-bin/</
code></
blockquote>