mod_alias.xml revision 04c83c4f6de6e7b087addba0377d998d2394699a
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi Copyright 2002-2004 The Apache Software Foundation
b062c76dff08accbdae415e6fed10ad6696b5a80takashi Licensed under the Apache License, Version 2.0 (the "License");
b062c76dff08accbdae415e6fed10ad6696b5a80takashi you may not use this file except in compliance with the License.
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc You may obtain a copy of the License at
2e545ce2450a9953665f701bb05350f0d3f26275nd Unless required by applicable law or agreed to in writing, software
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen distributed under the License is distributed on an "AS IS" BASIS,
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b062c76dff08accbdae415e6fed10ad6696b5a80takashi See the License for the specific language governing permissions and
b062c76dff08accbdae415e6fed10ad6696b5a80takashi limitations under the License.
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<description>Provides for mapping different parts of the host
b43f840409794ed298e8634f6284741f193b6c4ftakashi filesystem in the document tree and for URL redirection</description>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>The directives contained in this module allow for manipulation
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung and control of URLs as requests arrive at the server. The
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <directive module="mod_alias">Alias</directive> and <directive
b062c76dff08accbdae415e6fed10ad6696b5a80takashi module="mod_alias">ScriptAlias</directive> directives are used to
b062c76dff08accbdae415e6fed10ad6696b5a80takashi map between URLs and filesystem paths. This allows for content
b062c76dff08accbdae415e6fed10ad6696b5a80takashi which is not directly under the <directive
6a3ab831a34f470b077294a173f24fcf1e5f0a3ctakashi module="core">DocumentRoot</directive> served as part of the web
b062c76dff08accbdae415e6fed10ad6696b5a80takashi document tree. The <directive
b062c76dff08accbdae415e6fed10ad6696b5a80takashi module="mod_alias">ScriptAlias</directive> directive has the
b062c76dff08accbdae415e6fed10ad6696b5a80takashi additional effect of marking the target directory as containing
b062c76dff08accbdae415e6fed10ad6696b5a80takashi only CGI scripts.</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>The <directive module="mod_alias">Redirect</directive>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi directives are used to instruct clients to make a new request with
b062c76dff08accbdae415e6fed10ad6696b5a80takashi a different URL. They are often used when a resource has moved to
b062c76dff08accbdae415e6fed10ad6696b5a80takashi a new location.</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<seealso><module>mod_rewrite</module></seealso> <seealso><a
b062c76dff08accbdae415e6fed10ad6696b5a80takashihref="/urlmapping.html">Mapping URLs to the filesystem</a></seealso>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar<directivesynopsis>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<description>Maps URLs to filesystem locations</description>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<var>file-path</var>|<var>directory-path</var></syntax>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi<contextlist><context>server config</context><context>virtual host</context>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi</contextlist>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>The <directive>Alias</directive> directive allows documents to
b062c76dff08accbdae415e6fed10ad6696b5a80takashi be stored in the local filesystem other than under the
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <directive module="core">DocumentRoot</directive>. URLs with a
b062c76dff08accbdae415e6fed10ad6696b5a80takashi (%-decoded) path beginning with <var>url-path</var> will be mapped
b062c76dff08accbdae415e6fed10ad6696b5a80takashi to local files beginning with <var>directory-path</var>.</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>A request for http://myserver/image/foo.gif would cause the
b062c76dff08accbdae415e6fed10ad6696b5a80takashi server to return the file /ftp/pub/image/foo.gif.</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>Note that if you include a trailing / on the
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <var>url-path</var> then the server will require a trailing / in
b062c76dff08accbdae415e6fed10ad6696b5a80takashi order to expand the alias. That is, if you use <code>Alias
b062c76dff08accbdae415e6fed10ad6696b5a80takashi /icons/ /usr/local/apache/icons/</code> then the url
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>Note that you may need to specify additional <directive
b062c76dff08accbdae415e6fed10ad6696b5a80takashi type="section" module="core">Directory</directive> sections which
b062c76dff08accbdae415e6fed10ad6696b5a80takashi cover the <em>destination</em> of aliases. Aliasing occurs before
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <directive type="section" module="core">Directory</directive> sections
b062c76dff08accbdae415e6fed10ad6696b5a80takashi are checked, so only the destination of aliases are affected.
b062c76dff08accbdae415e6fed10ad6696b5a80takashi (Note however <directive type="section" module="core">Location</directive>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi sections are run through once before aliases are performed, so
b062c76dff08accbdae415e6fed10ad6696b5a80takashi they will apply.)</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi <p>In particular, if you are creating an <code>Alias</code> to a
b062c76dff08accbdae415e6fed10ad6696b5a80takashi directory outside of your <directive
b062c76dff08accbdae415e6fed10ad6696b5a80takashi module="core">DocumentRoot</directive>, you may need to explicitly
b062c76dff08accbdae415e6fed10ad6696b5a80takashi permit access to the target directory.</p>
b062c76dff08accbdae415e6fed10ad6696b5a80takashi Order allow,deny<br />
b062c76dff08accbdae415e6fed10ad6696b5a80takashi Allow from all<br />
11495c9f0bd33e51a25b4d532beadfbcf9b944a3nilgun </Directory>
0d0ba3a410038e179b695446bb149cce6264e0abnd</directivesynopsis>
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh<directivesynopsis>
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh<description>Maps URLs to filesystem locations using regular
727872d18412fc021f03969b8641810d8896820bhumbedoohexpressions</description>
0d0ba3a410038e179b695446bb149cce6264e0abnd<contextlist><context>server config</context><context>virtual host</context>
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh</contextlist>
727872d18412fc021f03969b8641810d8896820bhumbedooh module="mod_alias">Alias</directive>, but makes use of standard
0d0ba3a410038e179b695446bb149cce6264e0abnd regular expressions, instead of simple prefix matching. The
0d0ba3a410038e179b695446bb149cce6264e0abnd supplied regular expression is matched against the URL-path, and
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh if it matches, the server will substitute any parenthesized
205f749042ed530040a4f0080dbcb47ceae8a374rjung matches into the given string and use it as a filename. For
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen example, to activate the <code>/icons</code> directory, one might
Redirect /service http://foo2.bar.com/service
will be told to access http://foo2.bar.com/service/foo.txt
Redirect 303 /three http://example.com/other
RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg