mod_alias.html.en revision 04c83c4f6de6e7b087addba0377d998d2394699a
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<?xml version="1.0" encoding="ISO-8859-1"?>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd This file is generated from xml source: DO NOT EDIT
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding -->
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<title>mod_alias - Apache HTTP Server</title>
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding<link href="/images/favicon.ico" rel="shortcut icon" /></head>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<body>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<div id="page-header">
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<p class="apache">Apache HTTP Server Version 2.1</p>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<img alt="" src="/images/feather.gif" /></div>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<div id="path">
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<div id="page-content">
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<div id="preamble"><h1>Apache Module mod_alias</h1>
7db9f691a00ead175b03335457ca296a33ddf31bnd<div class="toplang">
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<p><span>Available Languages: </span><a href="/en/mod/mod_alias.html" title="English">&nbsp;en&nbsp;</a> |
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<a href="/ja/mod/mod_alias.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
9e5acc39290b3341429131dfb126394871e9837drbowen</div>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for mapping different parts of the host
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz filesystem in the document tree and for URL redirection</td></tr>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>alias_module</td></tr>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_alias.c</td></tr></table>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<h3>Summary</h3>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>The directives contained in this module allow for manipulation
3604deb3632beeca54cfdb3864d872715971c300slive and control of URLs as requests arrive at the server. The
3604deb3632beeca54cfdb3864d872715971c300slive <code class="directive"><a href="#alias">Alias</a></code> and <code class="directive"><a href="#scriptalias">ScriptAlias</a></code> directives are used to
3604deb3632beeca54cfdb3864d872715971c300slive map between URLs and filesystem paths. This allows for content
3604deb3632beeca54cfdb3864d872715971c300slive which is not directly under the <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code> served as part of the web
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz document tree. The <code class="directive"><a href="#scriptalias">ScriptAlias</a></code> directive has the
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes additional effect of marking the target directory as containing
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes only CGI scripts.</p>
87a0e78ba862eb998ccd545ae27c46c7ef89215abnicholes
92988aaf68a67c9fa417556cb944eba6bb82ef92rbowen <p>The <code class="directive"><a href="#redirect">Redirect</a></code>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz directives are used to instruct clients to make a new request with
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz a different URL. They are often used when a resource has moved to
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz a new location.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz</div>
3604deb3632beeca54cfdb3864d872715971c300slive<div id="quickview"><h3 class="directives">Directives</h3>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<ul id="toc">
3604deb3632beeca54cfdb3864d872715971c300slive<li><img alt="" src="/images/down.gif" /> <a href="#alias">Alias</a></li>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd<li><img alt="" src="/images/down.gif" /> <a href="#aliasmatch">AliasMatch</a></li>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd<li><img alt="" src="/images/down.gif" /> <a href="#redirect">Redirect</a></li>
f07998c217193b829f55c5ca8f4313ad5ba28f84nd<li><img alt="" src="/images/down.gif" /> <a href="#redirectmatch">RedirectMatch</a></li>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#redirectpermanent">RedirectPermanent</a></li>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<li><img alt="" src="/images/down.gif" /> <a href="#redirecttemp">RedirectTemp</a></li>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<li><img alt="" src="/images/down.gif" /> <a href="#scriptalias">ScriptAlias</a></li>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<li><img alt="" src="/images/down.gif" /> <a href="#scriptaliasmatch">ScriptAliasMatch</a></li>
3604deb3632beeca54cfdb3864d872715971c300slive</ul>
3604deb3632beeca54cfdb3864d872715971c300slive<h3>See also</h3>
3604deb3632beeca54cfdb3864d872715971c300slive<ul class="seealso">
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<li><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></li>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<li><a href="/urlmapping.html">Mapping URLs to the filesystem</a></li>
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar</ul></div>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<div class="directive-section"><h2><a name="Alias" id="Alias">Alias</a> <a name="alias" id="alias">Directive</a></h2>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<table class="directive">
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps URLs to filesystem locations</td></tr>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Alias <var>URL-path</var>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<var>file-path</var>|<var>directory-path</var></code></td></tr>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
41618b507c149c7adf89bd92a0cc2c6962a29dcfcovener<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim</table>
41618b507c149c7adf89bd92a0cc2c6962a29dcfcovener
41618b507c149c7adf89bd92a0cc2c6962a29dcfcovener <p>The <code class="directive">Alias</code> directive allows documents to
41618b507c149c7adf89bd92a0cc2c6962a29dcfcovener be stored in the local filesystem other than under the
3604deb3632beeca54cfdb3864d872715971c300slive <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>. URLs with a
3604deb3632beeca54cfdb3864d872715971c300slive (%-decoded) path beginning with <var>url-path</var> will be mapped
5632f75dd34db0112cf4b6b7527eb538c80d976cniq to local files beginning with <var>directory-path</var>.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <div class="example"><h3>Example:</h3><p><code>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz Alias /image /ftp/pub/image
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz </code></p></div>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <p>A request for http://myserver/image/foo.gif would cause the
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd server to return the file /ftp/pub/image/foo.gif.</p>
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <p>Note that if you include a trailing / on the
35ffb30f57f777dbf3f17c5a5ddf706559942c16nd <var>url-path</var> then the server will require a trailing / in
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz order to expand the alias. That is, if you use <code>Alias
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz /icons/ /usr/local/apache/icons/</code> then the url
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code>/icons</code> will not be aliased.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
3604deb3632beeca54cfdb3864d872715971c300slive <p>Note that you may need to specify additional <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code> sections which
3604deb3632beeca54cfdb3864d872715971c300slive cover the <em>destination</em> of aliases. Aliasing occurs before
3604deb3632beeca54cfdb3864d872715971c300slive <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code> sections
3604deb3632beeca54cfdb3864d872715971c300slive are checked, so only the destination of aliases are affected.
3604deb3632beeca54cfdb3864d872715971c300slive (Note however <code class="directive"><a href="/mod/core.html#location">&lt;Location&gt;</a></code>
3604deb3632beeca54cfdb3864d872715971c300slive sections are run through once before aliases are performed, so
3604deb3632beeca54cfdb3864d872715971c300slive they will apply.)</p>
3604deb3632beeca54cfdb3864d872715971c300slive
3604deb3632beeca54cfdb3864d872715971c300slive <p>In particular, if you are creating an <code>Alias</code> to a
3604deb3632beeca54cfdb3864d872715971c300slive directory outside of your <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>, you may need to explicitly
3604deb3632beeca54cfdb3864d872715971c300slive permit access to the target directory.</p>
3604deb3632beeca54cfdb3864d872715971c300slive
3604deb3632beeca54cfdb3864d872715971c300slive <div class="example"><h3>Example:</h3><p><code>
3604deb3632beeca54cfdb3864d872715971c300slive Alias /image /ftp/pub/image<br />
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz &lt;Directory /ftp/pub/image&gt;<br />
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <span class="indent">
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz Order allow,deny<br />
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin Allow from all<br />
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin </span>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin &lt;/Directory&gt;
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin </code></p></div>
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin</div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<div class="directive-section"><h2><a name="AliasMatch" id="AliasMatch">AliasMatch</a> <a name="aliasmatch" id="aliasmatch">Directive</a></h2>
9da97ff0bac3a0ff56a9cdebe6e5ab563636aa86jailletc<table class="directive">
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps URLs to filesystem locations using regular
fbc5cf5c3505692a5a250416bba8bc785783364aminfrinexpressions</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AliasMatch <var>regex</var>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<var>file-path</var>|<var>directory-path</var></code></td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin</table>
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin <p>This directive is equivalent to <code class="directive"><a href="#alias">Alias</a></code>, but makes use of standard
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin regular expressions, instead of simple prefix matching. The
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin supplied regular expression is matched against the URL-path, and
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin if it matches, the server will substitute any parenthesized
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin matches into the given string and use it as a filename. For
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin example, to activate the <code>/icons</code> directory, one might
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin use:</p>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin <div class="example"><p><code>
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar AliasMatch ^/icons(.*) /usr/local/apache/icons$1
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin </code></p></div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin</div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<div class="directive-section"><h2><a name="Redirect" id="Redirect">Redirect</a> <a name="redirect" id="redirect">Directive</a></h2>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<table class="directive">
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sends an external redirect asking the client to fetch
fbc5cf5c3505692a5a250416bba8bc785783364aminfrina different URL</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Redirect [<var>status</var>] <var>URL-path</var>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<var>URL</var></code></td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar</table>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin <p>The Redirect directive maps an old URL into a new one. The
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin new URL is returned to the client which attempts to fetch it
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin again with the new address. <var>URL-path</var> a (%-decoded)
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin path; any requests for documents beginning with this path will
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin be returned a redirect error to a new (%-encoded) URL beginning
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin with <var>URL</var>.</p>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin <div class="example"><h3>Example:</h3><p><code>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin Redirect /service http://foo2.bar.com/service
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin </code></p></div>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar <p>If the client requests http://myserver/service/foo.txt, it
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar will be told to access http://foo2.bar.com/service/foo.txt
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin instead.</p>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin<div class="note"><h3>Note</h3> <p>Redirect directives take precedence over
fbc5cf5c3505692a5a250416bba8bc785783364aminfrinAlias and ScriptAlias directives, irrespective of their ordering in
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrinthe configuration file. Also, <var>URL-path</var> must be a fully
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrinqualified URL, not a relative path, even when used with .htaccess files or
3658293f56f1683ca41e3bc5b70d98b203d8004bcoarinside of <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code>
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrinsections.</p></div>
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin <p>If no <var>status</var> argument is given, the redirect will
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin be "temporary" (HTTP status 302). This indicates to the client
3640cdf72453e58a12ca1f4b1de5c778ecde621dminfrin that the resource has moved temporarily. The <var>status</var>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin argument can be used to return other HTTP status codes:</p>
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin
fbc5cf5c3505692a5a250416bba8bc785783364aminfrin <dl>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dt>permanent</dt>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dd>Returns a permanent redirect status (301) indicating that
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd the resource has moved permanently.</dd>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dt>temp</dt>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dd>Returns a temporary redirect status (302). This is the
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd default.</dd>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
9da97ff0bac3a0ff56a9cdebe6e5ab563636aa86jailletc <dt>seeother</dt>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dd>Returns a "See Other" status (303) indicating that the
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd resource has been replaced.</dd>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dt>gone</dt>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <dd>Returns a "Gone" status (410) indicating that the
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd resource has been permanently removed. When this status is
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd used the <var>URL</var> argument should be omitted.</dd>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd </dl>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <p>Other status codes can be returned by giving the numeric
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd status code as the value of <var>status</var>. If the status is
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd between 300 and 399, the <var>URL</var> argument must be present,
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd otherwise it must be omitted. Note that the status must be
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd known to the Apache code (see the function
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <code>send_error_response</code> in http_protocol.c).</p>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <div class="example"><h3>Example:</h3><p><code>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd Redirect permanent /one http://example.com/two<br />
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd Redirect 303 /three http://example.com/other
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd </code></p></div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd</div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<div class="directive-section"><h2><a name="RedirectMatch" id="RedirectMatch">RedirectMatch</a> <a name="redirectmatch" id="redirectmatch">Directive</a></h2>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<table class="directive">
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sends an external redirect based on a regular expression match
5cb0075c38fc868730c4981e346845dad6c7ea58chrisdof the current URL</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RedirectMatch [<var>status</var>] <var>regex</var>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<var>URL</var></code></td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd</table>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <p>This directive is equivalent to <code class="directive"><a href="#redirect">Redirect</a></code>, but makes use of standard
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd regular expressions, instead of simple prefix matching. The
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd supplied regular expression is matched against the URL-path, and
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd if it matches, the server will substitute any parenthesized
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd matches into the given string and use it as a filename. For
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd example, to redirect all GIF files to like-named JPEG files on
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd another server, one might use:</p>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <div class="example"><p><code>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd </code></p></div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd</div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<div class="directive-section"><h2><a name="RedirectPermanent" id="RedirectPermanent">RedirectPermanent</a> <a name="redirectpermanent" id="redirectpermanent">Directive</a></h2>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<table class="directive">
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sends an external permanent redirect asking the client to fetch
5cb0075c38fc868730c4981e346845dad6c7ea58chrisda different URL</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RedirectPermanent <var>URL-path</var> <var>URL</var></code></td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd</table>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd <p>This directive makes the client know that the Redirect is
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd permanent (status 301). Exactly equivalent to <code>Redirect
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd permanent</code>.</p>
5cb0075c38fc868730c4981e346845dad6c7ea58chrisd
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RedirectTemp" id="RedirectTemp">RedirectTemp</a> <a name="redirecttemp" id="redirecttemp">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sends an external temporary redirect asking the client to fetch
a different URL</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RedirectTemp <var>URL-path</var> <var>URL</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
</table>
<p>This directive makes the client know that the Redirect is
only temporary (status 302). Exactly equivalent to
<code>Redirect temp</code>.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ScriptAlias" id="ScriptAlias">ScriptAlias</a> <a name="scriptalias" id="scriptalias">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps a URL to a filesystem location and designates the
target as a CGI script</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptAlias <var>URL-path</var>
<var>file-path</var>|<var>directory-path</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
</table>
<p>The <code class="directive">ScriptAlias</code> directive has the same
behavior as the <code class="directive"><a href="#alias">Alias</a></code>
directive, except that in addition it marks the target directory
as containing CGI scripts that will be processed by <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code>'s cgi-script handler. URLs with a
(%-decoded) path beginning with <var>URL-path</var> will be mapped
to scripts beginning with the second argument which is a full
pathname in the local filesystem.</p>
<div class="example"><h3>Example:</h3><p><code>
ScriptAlias /cgi-bin/ /web/cgi-bin/
</code></p></div>
<p>A request for <code>http://myserver/cgi-bin/foo</code> would cause the
server to run the script <code>/web/cgi-bin/foo</code>.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ScriptAliasMatch" id="ScriptAliasMatch">ScriptAliasMatch</a> <a name="scriptaliasmatch" id="scriptaliasmatch">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps a URL to a filesystem location using a regular expression
and designates the target as a CGI script</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptAliasMatch <var>regex</var>
<var>file-path</var>|<var>directory-path</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_alias</td></tr>
</table>
<p>This directive is equivalent to <code class="directive"><a href="#scriptalias">ScriptAlias</a></code>, but makes use of standard
regular expressions, instead of simple prefix matching. The
supplied regular expression is matched against the URL-path,
and if it matches, the server will substitute any parenthesized
matches into the given string and use it as a filename. For
example, to activate the standard <code>/cgi-bin</code>, one
might use:</p>
<div class="example"><p><code>
ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
</code></p></div>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="/en/mod/mod_alias.html" title="English">&nbsp;en&nbsp;</a> |
<a href="/ja/mod/mod_alias.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
</body></html>