mod_alias.html revision 7ec51ea96adc75769efcdc27edf7faba3badc3bf
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
530eba85dbd41b8a0fa5255d3648d1440199a661slive<HTML>
e942c741056732f50da2074b36fe59805d370650slive<HEAD>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<TITLE>Apache module mod_alias</TITLE>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</HEAD>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<BODY
530eba85dbd41b8a0fa5255d3648d1440199a661slive BGCOLOR="#FFFFFF"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive TEXT="#000000"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LINK="#0000FF"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive VLINK="#000080"
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess ALINK="#FF0000"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--#include virtual="header.html" -->
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H1 ALIGN="CENTER">Module mod_alias</H1>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabeleThis module is contained in the <CODE>mod_alias.c</CODE> file, and
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveis compiled in by default. It provides for mapping different parts of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivehost filesystem in the the document tree, and for URL redirection.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2>Directives</H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<UL>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#alias">Alias</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#aliasmatch">AliasMatch</A>
fb77c505254b6e9c925e23e734463e87574f8f40kess<LI><A HREF="#redirect">Redirect</A>
fb77c505254b6e9c925e23e734463e87574f8f40kess<LI><A HREF="#redirectmatch">RedirectMatch</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#redirecttemp">RedirectTemp</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#redirectperm">RedirectPermanent</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#scriptalias">ScriptAlias</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<LI><A HREF="#scriptaliasmatch">ScriptAliasMatch</A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</UL>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<HR>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="alias">Alias directive</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--%plaintext &lt;?INDEX {\tt Alias} directive&gt; -->
fb77c505254b6e9c925e23e734463e87574f8f40kess<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Syntax"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Syntax:</STRONG></A> Alias <EM>url-path directory-filename</EM><BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Context:</STRONG></A> server config, virtual host<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
fb77c505254b6e9c925e23e734463e87574f8f40kess><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess><STRONG>Module:</STRONG></A> mod_alias
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>
fb77c505254b6e9c925e23e734463e87574f8f40kessThe Alias directive allows documents to be stored in the local filesystem
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveother than under the <A HREF="core.html#documentroot">DocumentRoot</A>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveURLs with a (%-decoded) path beginning with <EM>url-path</EM> will be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemapped to local files beginning with <EM>directory-filename</EM>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
fb77c505254b6e9c925e23e734463e87574f8f40kessExample:
fb77c505254b6e9c925e23e734463e87574f8f40kess</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<BLOCKQUOTE><CODE>Alias /image /ftp/pub/image</CODE></BLOCKQUOTE>
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>
fb77c505254b6e9c925e23e734463e87574f8f40kessA request for http://myserver/image/foo.gif would cause the server to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivereturn the file /ftp/pub/image/foo.gif.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</P>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<P>
130d299c4b2b15be45532a176604c71fdc7bea5bndNote that if you include a trailing / on the <EM>url-path</EM> then the
130d299c4b2b15be45532a176604c71fdc7bea5bndserver will require a trailing / in order to expand the alias. That is,
130d299c4b2b15be45532a176604c71fdc7bea5bndif you use <CODE>Alias /icons/ /usr/local/apache/icons/</CODE> then
130d299c4b2b15be45532a176604c71fdc7bea5bndthe url <CODE>/icons</CODE> will not be aliased.
ef8e89e090461194ecadd31e8796a2c51e0531a2kess</P>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<P>
130d299c4b2b15be45532a176604c71fdc7bea5bndNote that you may need to specify additional
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<A HREF="core.html#directory"><CODE>&lt;Directory&gt;</CODE></A> sections
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndwhich cover the <EM>destination</EM> of aliases. Aliasing occurs
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivebefore <CODE>&lt;Directory&gt;</CODE> sections are checked, so only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivethe destination of aliases are affected. (Note however
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A HREF="core.html#location"><CODE>&lt;Location&gt;</CODE></A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivesections are run through once before aliases are performed, so they
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivewill apply.)
003f0c9fda6664daf5092a0e42f65ede20098153slive<P>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndSee also <A HREF="#scriptalias">ScriptAlias</A>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<HR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="aliasmatch">AliasMatch</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<A
003f0c9fda6664daf5092a0e42f65ede20098153slive HREF="directive-dict.html#Syntax"
003f0c9fda6664daf5092a0e42f65ede20098153slive REL="Help"
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess><STRONG>Syntax:</STRONG></A> AliasMatch <EM>regex directory-filename</EM><BR>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd REL="Help"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd><STRONG>Context:</STRONG></A> server config, virtual host<BR>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Module:</STRONG></A> mod_alias<BR>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<A
130d299c4b2b15be45532a176604c71fdc7bea5bnd HREF="directive-dict.html#Compatibility"
130d299c4b2b15be45532a176604c71fdc7bea5bnd REL="Help"
130d299c4b2b15be45532a176604c71fdc7bea5bnd><STRONG>Compatibility:</STRONG></A> Available in Apache 1.3 and later
130d299c4b2b15be45532a176604c71fdc7bea5bnd</P>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<P>This directive is equivalent to <A HREF="#alias">Alias</A>, but
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemakes use of standard regular expressions, instead of simple prefix
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivematching. The supplied regular expression is matched against the URL,
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveand if it matches, the server will substitute any parenthesized
1a3f62ca37273a15a06bb94a61d3c6fcf4bf38c9rbowenmatches into the given string and use it as a filename. For example,
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveto activate the <CODE>/icons</CODE> directory, one might use:
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<PRE>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AliasMatch ^/icons(.*) /usr/local/apache/icons$1
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</PRE>
003f0c9fda6664daf5092a0e42f65ede20098153slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<HR>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="redirect">Redirect directive</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--%plaintext &lt;?INDEX {\tt Redirect} directive&gt; -->
003f0c9fda6664daf5092a0e42f65ede20098153slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Syntax"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Syntax:</STRONG></A> Redirect [ <EM>status</EM> ]
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <EM>url-path url</EM><BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Context:</STRONG></A> server config, virtual host, directory,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive .htaccess<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Override"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Override:</STRONG></A> FileInfo<BR>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<A
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd HREF="directive-dict.html#Status"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
58699879a562774640b95e9eedfd891f336e38c2nd REL="Help"
58699879a562774640b95e9eedfd891f336e38c2nd><STRONG>Module:</STRONG></A> mod_alias<BR>
58699879a562774640b95e9eedfd891f336e38c2nd<A
fb77c505254b6e9c925e23e734463e87574f8f40kess HREF="directive-dict.html#Compatibility"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
58699879a562774640b95e9eedfd891f336e38c2nd><STRONG>Compatibility:</STRONG></A> The directory and .htaccess context's
58699879a562774640b95e9eedfd891f336e38c2ndare only available in versions 1.1 and later. The <EM>status</EM>
58699879a562774640b95e9eedfd891f336e38c2ndargument is only available in Apache 1.2 or later.
58699879a562774640b95e9eedfd891f336e38c2nd</P>
58699879a562774640b95e9eedfd891f336e38c2nd<P>
58699879a562774640b95e9eedfd891f336e38c2ndThe Redirect directive maps an old URL into a new one. The new URL is returned
58699879a562774640b95e9eedfd891f336e38c2ndto the client which attempts to fetch it again with the new address.
58699879a562774640b95e9eedfd891f336e38c2nd<EM>Url-path</EM> a (%-decoded) path; any requests for documents beginning with
58699879a562774640b95e9eedfd891f336e38c2ndthis path will be returned a redirect error to a new (%-encoded) url
58699879a562774640b95e9eedfd891f336e38c2ndbeginning with <EM>url</EM>.
58699879a562774640b95e9eedfd891f336e38c2nd</P>
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>
fb77c505254b6e9c925e23e734463e87574f8f40kessExample:
fb77c505254b6e9c925e23e734463e87574f8f40kess</P>
fb77c505254b6e9c925e23e734463e87574f8f40kess<BLOCKQUOTE><CODE>Redirect /service
fb77c505254b6e9c925e23e734463e87574f8f40kesshttp://foo2.bar.com/service</CODE></BLOCKQUOTE>
58699879a562774640b95e9eedfd891f336e38c2nd<P>
58699879a562774640b95e9eedfd891f336e38c2ndIf the client requests http://myserver/service/foo.txt, it will be told to
58699879a562774640b95e9eedfd891f336e38c2ndaccess http://foo2.bar.com/service/foo.txt instead.
58699879a562774640b95e9eedfd891f336e38c2nd</P>
58699879a562774640b95e9eedfd891f336e38c2nd<P>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<STRONG>Note:</STRONG> Redirect directives take precedence over Alias
6b64034fa2a644ba291c484c0c01c7df5b8d982ckessand ScriptAlias
58699879a562774640b95e9eedfd891f336e38c2nddirectives, irrespective of their ordering in the configuration file. Also,
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<EM>Url-path</EM> must be an absolute path, not a relative path, even
58699879a562774640b95e9eedfd891f336e38c2ndwhen used with .htaccess files or inside of &lt;Directory&gt; sections.
58699879a562774640b95e9eedfd891f336e38c2nd</P>
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>
fb77c505254b6e9c925e23e734463e87574f8f40kessIf no <EM>status</EM> argument is given, the redirect will be
fb77c505254b6e9c925e23e734463e87574f8f40kess&quot;temporary&quot; (HTTP status 302). This indicates to the client that the
58699879a562774640b95e9eedfd891f336e38c2ndresources is has moved temporarily. The <EM>status</EM>
58699879a562774640b95e9eedfd891f336e38c2ndargument can be used to return other HTTP status codes:
58699879a562774640b95e9eedfd891f336e38c2nd<P>
58699879a562774640b95e9eedfd891f336e38c2nd<DL>
58699879a562774640b95e9eedfd891f336e38c2nd<DT>permanent
58699879a562774640b95e9eedfd891f336e38c2nd<DD>Returns a permanent redirect status (301) indicating that
58699879a562774640b95e9eedfd891f336e38c2ndthe resource has moved permanently.
58699879a562774640b95e9eedfd891f336e38c2nd<DT>temp
58699879a562774640b95e9eedfd891f336e38c2nd<DD>Returns a temporary redirect status (302). This is the
58699879a562774640b95e9eedfd891f336e38c2nddefault.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<DT>seeother
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd<DD>Returns a "See Other" status (303) indicating that
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndthe resource has been replaced.
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<DT>gone
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<DD>Returns a "Gone" status (410) indicating that the resource
6b64034fa2a644ba291c484c0c01c7df5b8d982ckesshas been permanently removed. When this status is used the <EM>url</EM>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckessargument should be omitted.
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd</DL>
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd<P>
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndOther status codes can be returned by giving the numeric status code
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndas the value of <EM>status</EM>. If the status is between 300 and 399,
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndthe <EM>url</EM> argument must be present, otherwise it must be
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndomitted. Note that the status must be known to the Apache code (see
4a7affccb2f1f5b94cab395e1bf3825aed715ebcndthe function <CODE>send_error_response</CODE> in http_protocol.c).
ec9b02c6869b75575ada34c800672162833a2c06nd</P>
58699879a562774640b95e9eedfd891f336e38c2nd<HR>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd<H2><A NAME="redirectmatch">RedirectMatch</A></H2>
58699879a562774640b95e9eedfd891f336e38c2nd<P>
58699879a562774640b95e9eedfd891f336e38c2nd<A
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd HREF="directive-dict.html#Syntax"
58699879a562774640b95e9eedfd891f336e38c2nd REL="Help"
58699879a562774640b95e9eedfd891f336e38c2nd><STRONG>Syntax:</STRONG></A>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive RedirectMatch [<EM>status</EM>] <EM>regex url</EM>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<BR>
003f0c9fda6664daf5092a0e42f65ede20098153slive<A
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess HREF="directive-dict.html#Context"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd><STRONG>Context:</STRONG></A> server config, virtual host<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Override"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Override:</STRONG></A> FileInfo<BR>
fb77c505254b6e9c925e23e734463e87574f8f40kess<A
fb77c505254b6e9c925e23e734463e87574f8f40kess HREF="directive-dict.html#Status"
fb77c505254b6e9c925e23e734463e87574f8f40kess REL="Help"
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess HREF="directive-dict.html#Module"
10673857794a4b3d9568ca2d983722a87ed352f1rbowen REL="Help"
fb77c505254b6e9c925e23e734463e87574f8f40kess><STRONG>Module:</STRONG></A> mod_alias<BR>
fb77c505254b6e9c925e23e734463e87574f8f40kess<A
10673857794a4b3d9568ca2d983722a87ed352f1rbowen HREF="directive-dict.html#Compatibility"
6af14face8dcdab3a5cd88fcdda91c268f7a3745slive REL="Help"
10673857794a4b3d9568ca2d983722a87ed352f1rbowen><STRONG>Compatibility:</STRONG></A> Available in Apache 1.3 and later
10673857794a4b3d9568ca2d983722a87ed352f1rbowen</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>This directive is equivalent to <A HREF="#alias">Redirect</A>, but
fb77c505254b6e9c925e23e734463e87574f8f40kessmakes use of standard regular expressions, instead of simple prefix
fb77c505254b6e9c925e23e734463e87574f8f40kessmatching. The supplied regular expression is matched against the URL,
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveand if it matches, the server will substitute any parenthesized
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivematches into the given string and use it as a filename. For example,
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveto redirect all GIF files to like-named JPEG files on another server,
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveone might use:
fb77c505254b6e9c925e23e734463e87574f8f40kess<PRE>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</PRE>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<HR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="redirecttemp">RedirectTemp directive</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--%plaintext &lt;?INDEX {\tt Redirect} directive&gt; -->
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz HREF="directive-dict.html#Syntax"
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz REL="Help"
9ed9eaf871c58d281af02e76125ceadb5060afa5nd><STRONG>Syntax:</STRONG></A> RedirectTemp <EM>url-path url</EM><BR>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Context:</STRONG></A> server config, virtual host, directory,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive .htaccess<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Override"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Override:</STRONG></A> FileInfo<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Module:</STRONG></A> mod_alias<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Compatibility"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Compatibility:</STRONG></A> This directive is only available in 1.2
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveThis directive makes the client know that the Redirect is only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivetemporary (status 302). Exactly equivalent to <CODE>Redirect
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivetemp</CODE>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<HR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="redirectperm">RedirectPermanent directive</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--%plaintext &lt;?INDEX {\tt Redirect} directive&gt; -->
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Syntax"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Syntax:</STRONG></A> RedirectPermanent <EM>url-path url</EM><BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Context:</STRONG></A> server config, virtual host, directory,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive .htaccess<BR>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<A
9ed9eaf871c58d281af02e76125ceadb5060afa5nd HREF="directive-dict.html#Override"
9ed9eaf871c58d281af02e76125ceadb5060afa5nd REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Override:</STRONG></A> FileInfo<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Module:</STRONG></A> mod_alias<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Compatibility"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd REL="Help"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd><STRONG>Compatibility:</STRONG></A> This directive is only available in 1.2
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveThis directive makes the client know that the Redirect is permanent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive(status 301). Exactly equivalent to <CODE>Redirect permanent</CODE>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
54bcd0e21a5c79158afd3b78bf707a493a5fb33crbowen<HR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="scriptalias">ScriptAlias directive</A></H2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<!--%plaintext &lt;?INDEX {\tt ScriptAlias} directive&gt; -->
003f0c9fda6664daf5092a0e42f65ede20098153slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Syntax"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Syntax:</STRONG></A> ScriptAlias <EM>url-path directory-filename</EM>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Context:</STRONG></A> server config, virtual host<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Module"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
9ed9eaf871c58d281af02e76125ceadb5060afa5nd><STRONG>Module:</STRONG></A> mod_alias
9ed9eaf871c58d281af02e76125ceadb5060afa5nd</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveThe ScriptAlias directive has the same behavior as the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A HREF="#alias">Alias</A> directive, except that in addition it
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemarks the target directory as containing CGI scripts.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndURLs with a (%-decoded) path beginning with <EM>url-path</EM> will be
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndmapped to scripts beginning with <EM>directory-filename</EM>.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveExample:
1c9f7cdf2e1bc8313e559a96638c3c36e3143791yoshiki</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<BLOCKQUOTE><CODE>ScriptAlias /cgi-bin/ /web/cgi-bin/</CODE></BLOCKQUOTE>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<P>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessA request for http://myserver/cgi-bin/foo would cause the server to
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessrun the script /web/cgi-bin/foo.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<HR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<H2><A NAME="scriptaliasmatch">ScriptAliasMatch</A></H2>
003f0c9fda6664daf5092a0e42f65ede20098153slive<P>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Syntax"
530eba85dbd41b8a0fa5255d3648d1440199a661slive REL="Help"
530eba85dbd41b8a0fa5255d3648d1440199a661slive><STRONG>Syntax:</STRONG></A> ScriptAliasMatch
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <EM>regex directory-filename</EM><BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Context"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess><STRONG>Context:</STRONG></A> server config, virtual host<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Status"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Status:</STRONG></A> Base<BR>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<A
9ed9eaf871c58d281af02e76125ceadb5060afa5nd HREF="directive-dict.html#Module"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Module:</STRONG></A> mod_alias<BR>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<A
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HREF="directive-dict.html#Compatibility"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive REL="Help"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive><STRONG>Compatibility:</STRONG></A> Available in Apache 1.3 and later
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes</P>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes
fb77c505254b6e9c925e23e734463e87574f8f40kess<P>This directive is equivalent to <A HREF="#scriptalias">ScriptAlias</A>, but
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholesmakes use of standard regular expressions, instead of simple prefix
fb77c505254b6e9c925e23e734463e87574f8f40kessmatching. The supplied regular expression is matched against the URL,
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholesand if it matches, the server will substitute any parenthesized
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholesmatches into the given string and use it as a filename. For example,
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholesto activate the standard <CODE>/cgi-bin</CODE>, one might use:
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes<PRE>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes</PRE>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes</P>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess<!--#include virtual="footer.html" -->
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</BODY>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</HTML>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes