mod_dir.xml revision d24d4c5159bcb11c25bb294926cfe7105c789ea9
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<modulesynopsis>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<description>Provides for "trailing slash" redirects and
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive serving directory index files</description>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The index of a directory can come from one of two sources:</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <li>A file written by the user, typically called
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>index.html</code>. The <directive module="mod_dir"
6a7d71eb77725eb1b1091a94289696ab07946c7bslive >DirectoryIndex</directive> directive sets the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive name of this file. This is controlled by
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <li>Otherwise, a listing generated by the server. This is
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The two functions are separated so that you can completely
6a7d71eb77725eb1b1091a94289696ab07946c7bslive remove (or replace) automatic index generation should you want
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>A "trailing slash" redirect is issued when the server
6a7d71eb77725eb1b1091a94289696ab07946c7bslive receives a request for a URL
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>dirname</code> is a directory. Directories require a
6a7d71eb77725eb1b1091a94289696ab07946c7bslive trailing slash, so <module>mod_dir</module> issues a redirect to
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<directivesynopsis>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<description>List of resources to look for when the client requests
6a7d71eb77725eb1b1091a94289696ab07946c7bslivea directory</description>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<syntax>DirectoryIndex
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</contextlist>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The <directive>DirectoryIndex</directive> directive sets the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive list of resources to look for, when the client requests an index
6a7d71eb77725eb1b1091a94289696ab07946c7bslive of the directory by specifying a / at the end of the a directory
6a7d71eb77725eb1b1091a94289696ab07946c7bslive name. <em>Local-url</em> is the (%-encoded) URL of a document on
6a7d71eb77725eb1b1091a94289696ab07946c7bslive the server relative to the requested directory; it is usually the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive name of a file in the directory. Several URLs may be given, in
6a7d71eb77725eb1b1091a94289696ab07946c7bslive which case the server will return the first one that it finds. If
6a7d71eb77725eb1b1091a94289696ab07946c7bslive none of the resources exist and the <code>Indexes</code> option is
6a7d71eb77725eb1b1091a94289696ab07946c7bslive set, the server will generate its own listing of the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive directory.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bsliveDirectoryIndex index.html
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>then a request for <code>http://myserver/docs/</code> would
6a7d71eb77725eb1b1091a94289696ab07946c7bslive return <code>http://myserver/docs/index.html</code> if it
6a7d71eb77725eb1b1091a94289696ab07946c7bslive exists, or would list the directory if it did not.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>Note that the documents do not need to be relative to the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive directory;</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<example>DirectoryIndex index.html index.txt /cgi-bin/index.pl</example>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</directivesynopsis>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</modulesynopsis>