mod_alias.xml revision 52ebee778263c25c1b366f5e296d3f973fcb7aba
88f76f668542dcd72fc9d71577997967c6bf123bslive<?xml version="1.0"?>
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_alias.xml.meta">
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>mod_alias</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Provides for mapping different parts of the host
88f76f668542dcd72fc9d71577997967c6bf123bslive filesystem in the document tree and for URL redirection</description>
88f76f668542dcd72fc9d71577997967c6bf123bslive<status>Base</status>
88f76f668542dcd72fc9d71577997967c6bf123bslive<sourcefile>mod_alias.c</sourcefile>
88f76f668542dcd72fc9d71577997967c6bf123bslive<identifier>alias_module</identifier>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<summary>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>The directives contained in this module allow for manipulation
88f76f668542dcd72fc9d71577997967c6bf123bslive and control of URLs as requests arrive at the server. The
88f76f668542dcd72fc9d71577997967c6bf123bslive <directive module="mod_alias">Alias</directive> and <directive
88f76f668542dcd72fc9d71577997967c6bf123bslive module="mod_alias">ScriptAlias</directive> directives are used to
88f76f668542dcd72fc9d71577997967c6bf123bslive map between URLs and filesystem paths. This allows for content
88f76f668542dcd72fc9d71577997967c6bf123bslive which is not directly under the <directive
88f76f668542dcd72fc9d71577997967c6bf123bslive module="core">DocumentRoot</directive> served as part of the web
88f76f668542dcd72fc9d71577997967c6bf123bslive document tree. The <directive
88f76f668542dcd72fc9d71577997967c6bf123bslive module="mod_alias">ScriptAlias</directive> directive has the
88f76f668542dcd72fc9d71577997967c6bf123bslive additional effect of marking the target directory as containing
88f76f668542dcd72fc9d71577997967c6bf123bslive only CGI scripts.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>The <directive module="mod_alias">Redirect</directive>
88f76f668542dcd72fc9d71577997967c6bf123bslive directives are used to instruct clients to make a new request with
88f76f668542dcd72fc9d71577997967c6bf123bslive a different URL. They are often used when a resource has moved to
88f76f668542dcd72fc9d71577997967c6bf123bslive a new location.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive</summary>
88f76f668542dcd72fc9d71577997967c6bf123bslive
38677582e6ddf26e810728a68cbe560345486e48slive<seealso><module>mod_rewrite</module></seealso> <seealso><a
38677582e6ddf26e810728a68cbe560345486e48slivehref="/urlmapping.html">Mapping URLs to the filesystem</a></seealso>
38677582e6ddf26e810728a68cbe560345486e48slive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>Alias</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Maps URLs to filesystem locations</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>Alias <var>URL-path</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>file-path</var>|<var>directory-path</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive</contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>The <directive>Alias</directive> directive allows documents to
88f76f668542dcd72fc9d71577997967c6bf123bslive be stored in the local filesystem other than under the
88f76f668542dcd72fc9d71577997967c6bf123bslive <directive module="core">DocumentRoot</directive>. URLs with a
67a715b4352c3e25bff32fccad48350180393f5end (%-decoded) path beginning with <var>url-path</var> will be mapped
67a715b4352c3e25bff32fccad48350180393f5end to local files beginning with <var>directory-path</var>.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Example:</title>
67a715b4352c3e25bff32fccad48350180393f5end Alias /image /ftp/pub/image
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>A request for http://myserver/image/foo.gif would cause the
88f76f668542dcd72fc9d71577997967c6bf123bslive server to return the file /ftp/pub/image/foo.gif.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>Note that if you include a trailing / on the
67a715b4352c3e25bff32fccad48350180393f5end <var>url-path</var> then the server will require a trailing / in
88f76f668542dcd72fc9d71577997967c6bf123bslive order to expand the alias. That is, if you use <code>Alias
88f76f668542dcd72fc9d71577997967c6bf123bslive /icons/ /usr/local/apache/icons/</code> then the url
88f76f668542dcd72fc9d71577997967c6bf123bslive <code>/icons</code> will not be aliased.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>Note that you may need to specify additional <directive
0dd298aa254f43fc223b1cc41e79d4a1fec308bcnd type="section" module="core">Directory</directive> sections which
0dd298aa254f43fc223b1cc41e79d4a1fec308bcnd cover the <em>destination</em> of aliases. Aliasing occurs before
0dd298aa254f43fc223b1cc41e79d4a1fec308bcnd <directive type="section" module="core">Directory</directive> sections
88f76f668542dcd72fc9d71577997967c6bf123bslive are checked, so only the destination of aliases are affected.
0dd298aa254f43fc223b1cc41e79d4a1fec308bcnd (Note however <directive type="section" module="core">Location</directive>
88f76f668542dcd72fc9d71577997967c6bf123bslive sections are run through once before aliases are performed, so
88f76f668542dcd72fc9d71577997967c6bf123bslive they will apply.)</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
0287d5784a0533920978a7eb8f3cdeace17b467arbowen <p>In particular, if you are creating an <code>Alias</code> to a
0287d5784a0533920978a7eb8f3cdeace17b467arbowen directory outside of your <directive
52ebee778263c25c1b366f5e296d3f973fcb7aband module="core">DocumentRoot</directive>, you may need to explicitly
0287d5784a0533920978a7eb8f3cdeace17b467arbowen permit access to the target directory.</p>
0287d5784a0533920978a7eb8f3cdeace17b467arbowen
0287d5784a0533920978a7eb8f3cdeace17b467arbowen <example><title>Example:</title>
2348633f2de9e8a3228db792f189d8b6ffdfdafand Alias /image /ftp/pub/image<br />
2348633f2de9e8a3228db792f189d8b6ffdfdafand &lt;Directory /ftp/pub/image&gt;<br />
2348633f2de9e8a3228db792f189d8b6ffdfdafand <indent>
2348633f2de9e8a3228db792f189d8b6ffdfdafand Order allow,deny<br />
2348633f2de9e8a3228db792f189d8b6ffdfdafand Allow from all<br />
2348633f2de9e8a3228db792f189d8b6ffdfdafand </indent>
0287d5784a0533920978a7eb8f3cdeace17b467arbowen &lt;/Directory&gt;
0287d5784a0533920978a7eb8f3cdeace17b467arbowen </example>
0287d5784a0533920978a7eb8f3cdeace17b467arbowen
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>AliasMatch</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Maps URLs to filesystem locations using regular
88f76f668542dcd72fc9d71577997967c6bf123bsliveexpressions</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>AliasMatch <var>regex</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>file-path</var>|<var>directory-path</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive</contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>This directive is equivalent to <directive
88f76f668542dcd72fc9d71577997967c6bf123bslive module="mod_alias">Alias</directive>, but makes use of standard
88f76f668542dcd72fc9d71577997967c6bf123bslive regular expressions, instead of simple prefix matching. The
88f76f668542dcd72fc9d71577997967c6bf123bslive supplied regular expression is matched against the URL-path, and
88f76f668542dcd72fc9d71577997967c6bf123bslive if it matches, the server will substitute any parenthesized
88f76f668542dcd72fc9d71577997967c6bf123bslive matches into the given string and use it as a filename. For
88f76f668542dcd72fc9d71577997967c6bf123bslive example, to activate the <code>/icons</code> directory, one might
88f76f668542dcd72fc9d71577997967c6bf123bslive use:</p>
67a715b4352c3e25bff32fccad48350180393f5end
67a715b4352c3e25bff32fccad48350180393f5end <example>
67a715b4352c3e25bff32fccad48350180393f5end AliasMatch ^/icons(.*) /usr/local/apache/icons$1
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>Redirect</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Sends an external redirect asking the client to fetch
88f76f668542dcd72fc9d71577997967c6bf123bslivea different URL</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>Redirect [<var>status</var>] <var>URL-path</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>URL</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive<context>directory</context><context>.htaccess</context></contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive<override>FileInfo</override>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>The Redirect directive maps an old URL into a new one. The
88f76f668542dcd72fc9d71577997967c6bf123bslive new URL is returned to the client which attempts to fetch it
67a715b4352c3e25bff32fccad48350180393f5end again with the new address. <var>URL-path</var> a (%-decoded)
88f76f668542dcd72fc9d71577997967c6bf123bslive path; any requests for documents beginning with this path will
88f76f668542dcd72fc9d71577997967c6bf123bslive be returned a redirect error to a new (%-encoded) URL beginning
67a715b4352c3e25bff32fccad48350180393f5end with <var>URL</var>.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Example:</title>
67a715b4352c3e25bff32fccad48350180393f5end Redirect /service http://foo2.bar.com/service
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>If the client requests http://myserver/service/foo.txt, it
88f76f668542dcd72fc9d71577997967c6bf123bslive will be told to access http://foo2.bar.com/service/foo.txt
88f76f668542dcd72fc9d71577997967c6bf123bslive instead.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<note><title>Note</title> <p>Redirect directives take precedence over
88f76f668542dcd72fc9d71577997967c6bf123bsliveAlias and ScriptAlias directives, irrespective of their ordering in
67a715b4352c3e25bff32fccad48350180393f5endthe configuration file. Also, <var>URL-path</var> must be an absolute
88f76f668542dcd72fc9d71577997967c6bf123bslivepath, not a relative path, even when used with .htaccess files or
0dd298aa254f43fc223b1cc41e79d4a1fec308bcndinside of <directive type="section" module="core">Directory</directive>
88f76f668542dcd72fc9d71577997967c6bf123bslivesections.</p></note>
88f76f668542dcd72fc9d71577997967c6bf123bslive
67a715b4352c3e25bff32fccad48350180393f5end <p>If no <var>status</var> argument is given, the redirect will
88f76f668542dcd72fc9d71577997967c6bf123bslive be "temporary" (HTTP status 302). This indicates to the client
67a715b4352c3e25bff32fccad48350180393f5end that the resource has moved temporarily. The <var>status</var>
88f76f668542dcd72fc9d71577997967c6bf123bslive argument can be used to return other HTTP status codes:</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dl>
88f76f668542dcd72fc9d71577997967c6bf123bslive <dt>permanent</dt>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dd>Returns a permanent redirect status (301) indicating that
88f76f668542dcd72fc9d71577997967c6bf123bslive the resource has moved permanently.</dd>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dt>temp</dt>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dd>Returns a temporary redirect status (302). This is the
88f76f668542dcd72fc9d71577997967c6bf123bslive default.</dd>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dt>seeother</dt>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dd>Returns a "See Other" status (303) indicating that the
88f76f668542dcd72fc9d71577997967c6bf123bslive resource has been replaced.</dd>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dt>gone</dt>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <dd>Returns a "Gone" status (410) indicating that the
88f76f668542dcd72fc9d71577997967c6bf123bslive resource has been permanently removed. When this status is
67a715b4352c3e25bff32fccad48350180393f5end used the <var>URL</var> argument should be omitted.</dd>
88f76f668542dcd72fc9d71577997967c6bf123bslive </dl>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>Other status codes can be returned by giving the numeric
67a715b4352c3e25bff32fccad48350180393f5end status code as the value of <var>status</var>. If the status is
67a715b4352c3e25bff32fccad48350180393f5end between 300 and 399, the <var>URL</var> argument must be present,
88f76f668542dcd72fc9d71577997967c6bf123bslive otherwise it must be omitted. Note that the status must be
88f76f668542dcd72fc9d71577997967c6bf123bslive known to the Apache code (see the function
88f76f668542dcd72fc9d71577997967c6bf123bslive <code>send_error_response</code> in http_protocol.c).</p>
bd63a8c7b38d0af10e7c9d891a245913daabd352rbowen
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Example:</title>
67a715b4352c3e25bff32fccad48350180393f5end Redirect permanent /one http://example.com/two<br />
67a715b4352c3e25bff32fccad48350180393f5end Redirect 303 /three http://example.com/other
bd63a8c7b38d0af10e7c9d891a245913daabd352rbowen </example>
bd63a8c7b38d0af10e7c9d891a245913daabd352rbowen
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>RedirectMatch</name>
15ba1801088da1aad6d20609cf3f7b0b1eefce8aslive<description>Sends an external redirect based on a regular expression match
15ba1801088da1aad6d20609cf3f7b0b1eefce8asliveof the current URL</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>RedirectMatch [<var>status</var>] <var>regex</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>URL</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive<context>directory</context><context>.htaccess</context></contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive<override>FileInfo</override>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>This directive is equivalent to <directive
88f76f668542dcd72fc9d71577997967c6bf123bslive module="mod_alias">Redirect</directive>, but makes use of standard
88f76f668542dcd72fc9d71577997967c6bf123bslive regular expressions, instead of simple prefix matching. The
88f76f668542dcd72fc9d71577997967c6bf123bslive supplied regular expression is matched against the URL-path, and
88f76f668542dcd72fc9d71577997967c6bf123bslive if it matches, the server will substitute any parenthesized
88f76f668542dcd72fc9d71577997967c6bf123bslive matches into the given string and use it as a filename. For
88f76f668542dcd72fc9d71577997967c6bf123bslive example, to redirect all GIF files to like-named JPEG files on
88f76f668542dcd72fc9d71577997967c6bf123bslive another server, one might use:</p>
67a715b4352c3e25bff32fccad48350180393f5end
67a715b4352c3e25bff32fccad48350180393f5end <example>
67a715b4352c3e25bff32fccad48350180393f5end RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>RedirectTemp</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Sends an external temporary redirect asking the client to fetch
88f76f668542dcd72fc9d71577997967c6bf123bslivea different URL</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>RedirectTemp <var>URL-path</var> <var>URL</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive<context>directory</context><context>.htaccess</context></contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive<override>FileInfo</override>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>This directive makes the client know that the Redirect is
88f76f668542dcd72fc9d71577997967c6bf123bslive only temporary (status 302). Exactly equivalent to
88f76f668542dcd72fc9d71577997967c6bf123bslive <code>Redirect temp</code>.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>RedirectPermanent</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Sends an external permanent redirect asking the client to fetch
88f76f668542dcd72fc9d71577997967c6bf123bslivea different URL</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>RedirectPermanent <var>URL-path</var> <var>URL</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive<context>directory</context><context>.htaccess</context></contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive<override>FileInfo</override>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>This directive makes the client know that the Redirect is
88f76f668542dcd72fc9d71577997967c6bf123bslive permanent (status 301). Exactly equivalent to <code>Redirect
88f76f668542dcd72fc9d71577997967c6bf123bslive permanent</code>.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>ScriptAlias</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Maps a URL to a filesystem location and designates the
88f76f668542dcd72fc9d71577997967c6bf123bslivetarget as a CGI script</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>ScriptAlias <var>URL-path</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>file-path</var>|<var>directory-path</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive</contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>The <directive>ScriptAlias</directive> directive has the same
88f76f668542dcd72fc9d71577997967c6bf123bslive behavior as the <directive module="mod_alias">Alias</directive>
88f76f668542dcd72fc9d71577997967c6bf123bslive directive, except that in addition it marks the target directory
88f76f668542dcd72fc9d71577997967c6bf123bslive as containing CGI scripts that will be processed by <module
88f76f668542dcd72fc9d71577997967c6bf123bslive >mod_cgi</module>'s cgi-script handler. URLs with a
67a715b4352c3e25bff32fccad48350180393f5end (%-decoded) path beginning with <var>URL-path</var> will be mapped
88f76f668542dcd72fc9d71577997967c6bf123bslive to scripts beginning with the second argument which is a full
88f76f668542dcd72fc9d71577997967c6bf123bslive pathname in the local filesystem.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive
67a715b4352c3e25bff32fccad48350180393f5end <example><title>Example:</title>
67a715b4352c3e25bff32fccad48350180393f5end ScriptAlias /cgi-bin/ /web/cgi-bin/
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>A request for <code>http://myserver/cgi-bin/foo</code> would cause the
88f76f668542dcd72fc9d71577997967c6bf123bslive server to run the script <code>/web/cgi-bin/foo</code>.</p>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive<name>ScriptAliasMatch</name>
88f76f668542dcd72fc9d71577997967c6bf123bslive<description>Maps a URL to a filesystem location using a regular expression
88f76f668542dcd72fc9d71577997967c6bf123bsliveand designates the target as a CGI script</description>
67a715b4352c3e25bff32fccad48350180393f5end<syntax>ScriptAliasMatch <var>regex</var>
67a715b4352c3e25bff32fccad48350180393f5end<var>file-path</var>|<var>directory-path</var></syntax>
88f76f668542dcd72fc9d71577997967c6bf123bslive<contextlist><context>server config</context><context>virtual host</context>
88f76f668542dcd72fc9d71577997967c6bf123bslive</contextlist>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive<usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive <p>This directive is equivalent to <directive module="mod_alias"
88f76f668542dcd72fc9d71577997967c6bf123bslive >ScriptAlias</directive>, but makes use of standard
88f76f668542dcd72fc9d71577997967c6bf123bslive regular expressions, instead of simple prefix matching. The
88f76f668542dcd72fc9d71577997967c6bf123bslive supplied regular expression is matched against the URL-path,
88f76f668542dcd72fc9d71577997967c6bf123bslive and if it matches, the server will substitute any parenthesized
88f76f668542dcd72fc9d71577997967c6bf123bslive matches into the given string and use it as a filename. For
88f76f668542dcd72fc9d71577997967c6bf123bslive example, to activate the standard <code>/cgi-bin</code>, one
88f76f668542dcd72fc9d71577997967c6bf123bslive might use:</p>
67a715b4352c3e25bff32fccad48350180393f5end
67a715b4352c3e25bff32fccad48350180393f5end <example>
67a715b4352c3e25bff32fccad48350180393f5end ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1
67a715b4352c3e25bff32fccad48350180393f5end </example>
88f76f668542dcd72fc9d71577997967c6bf123bslive</usage>
88f76f668542dcd72fc9d71577997967c6bf123bslive</directivesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive
88f76f668542dcd72fc9d71577997967c6bf123bslive</modulesynopsis>
88f76f668542dcd72fc9d71577997967c6bf123bslive