mod_alias.xml revision 2348633f2de9e8a3228db792f189d8b6ffdfdafa
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<modulesynopsis>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<description>Provides for mapping different parts of the host
5a58787efeb02a1c3f06569d019ad81fd2efa06end filesystem in the document tree and for URL redirection</description>
5a58787efeb02a1c3f06569d019ad81fd2efa06end <p>The directives contained in this module allow for manipulation
5a58787efeb02a1c3f06569d019ad81fd2efa06end and control of URLs as requests arrive at the server. The
5a58787efeb02a1c3f06569d019ad81fd2efa06end <directive module="mod_alias">Alias</directive> and <directive
5a58787efeb02a1c3f06569d019ad81fd2efa06end module="mod_alias">ScriptAlias</directive> directives are used to
5a58787efeb02a1c3f06569d019ad81fd2efa06end map between URLs and filesystem paths. This allows for content
5a58787efeb02a1c3f06569d019ad81fd2efa06end which is not directly under the <directive
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd module="core">DocumentRoot</directive> served as part of the web
a78048ccbdb6256da15e6b0e7e95355e480c2301nd document tree. The <directive
b05ab3ff5ab54aa22610b13d56eaba6ddfc3db60nd module="mod_alias">ScriptAlias</directive> directive has the
a78048ccbdb6256da15e6b0e7e95355e480c2301nd additional effect of marking the target directory as containing
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd only CGI scripts.</p>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>The <directive module="mod_alias">Redirect</directive>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive directives are used to instruct clients to make a new request with
5a58787efeb02a1c3f06569d019ad81fd2efa06end a different URL. They are often used when a resource has moved to
5a58787efeb02a1c3f06569d019ad81fd2efa06end a new location.</p>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<seealso><module>mod_rewrite</module></seealso> <seealso><a
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slivehref="/urlmapping.html">Mapping URLs to the filesystem</a></seealso>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<directivesynopsis>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<description>Maps URLs to filesystem locations</description>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<var>file-path</var>|<var>directory-path</var></syntax>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive<contextlist><context>server config</context><context>virtual host</context>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive</contextlist>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>The <directive>Alias</directive> directive allows documents to
9bcfc3697a91b5215893a7d0206865b13fc72148nd be stored in the local filesystem other than under the
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <directive module="core">DocumentRoot</directive>. URLs with a
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive (%-decoded) path beginning with <var>url-path</var> will be mapped
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive to local files beginning with <var>directory-path</var>.</p>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>A request for http://myserver/image/foo.gif would cause the
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>Note that if you include a trailing / on the
9bcfc3697a91b5215893a7d0206865b13fc72148nd <var>url-path</var> then the server will require a trailing / in
a8703cfb67133446eef7af1043640e71486e9ecand order to expand the alias. That is, if you use <code>Alias
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>Note that you may need to specify additional <directive
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive type="section" module="core">Directory</directive> sections which
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive cover the <em>destination</em> of aliases. Aliasing occurs before
9bcfc3697a91b5215893a7d0206865b13fc72148nd <directive type="section" module="core">Directory</directive> sections
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive are checked, so only the destination of aliases are affected.
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive (Note however <directive type="section" module="core">Location</directive>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive sections are run through once before aliases are performed, so
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive they will apply.)</p>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive <p>In particular, if you are creating an <code>Alias</code> to a
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive directory outside of your <directive
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive module="code">DocumentRoot</directive>, you may need to explicitly
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive permit access to the target directory.</p>
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive Order allow,deny<br />
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive Allow from all<br />
f78ba66d5075af3e07e2d93aa7fa7b884836c6e8slive </Directory>
fe3e19e712f4f977166c1ca02b5ee6435c12df8fnd </example>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</directivesynopsis>
b05ab3ff5ab54aa22610b13d56eaba6ddfc3db60nd<directivesynopsis>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<description>Maps URLs to filesystem locations using regular
35714556a25fceb7c9bf9c4e01791b2e2a4c27c3ndexpressions</description>
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