mod_dir.html.en revision a945f35eff8b6a88009ce73de6d4c862ce58de3c
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is generated from xml source: DO NOT EDIT
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive --><title>mod_dir - Apache HTTP Server</title><link href="/style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_dir</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap" valign="top"><span class="help">Description:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </span></td><td>Provides for "trailing slash" redirects and
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive serving directory index files</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#Status" class="help">Status:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>Base</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#ModuleIdentifier" class="help">Module Identifier:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>dir_module</td></tr></table></td></tr></table><h2>Summary</h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The index of a directory can come from one of two sources:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>A file written by the user, typically called
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>index.html</code>. The <a href="#directoryindex" class="directive"><code class="directive">DirectoryIndex</code></a> directive sets the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive name of this file. This is controlled by
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive <code><a href="/mod/mod_dir.html">mod_dir</a></code>.</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <li>Otherwise, a listing generated by the server. This is
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive provided by <code><a href="/mod/mod_autoindex.html">mod_autoindex</a></code>.</li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The two functions are separated so that you can completely
06ba4a61654b3763ad65f52283832ebf058fdf1cslive remove (or replace) automatic index generation should you want
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A "trailing slash" redirect is issued when the server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive receives a request for a URL
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>dirname</code> is a directory. Directories require a
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive trailing slash, so <code><a href="/mod/mod_dir.html">mod_dir</a></code> issues a redirect to
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<h2>Directives</h2><ul><li><a href="#directoryindex">DirectoryIndex</a></li></ul><hr/><h2><a name="DirectoryIndex">DirectoryIndex</a> <a name="directoryindex">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </strong></td><td>List of resources to look for when the client requests
a945f35eff8b6a88009ce73de6d4c862ce58de3cslivea directory</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive <em>local-url</em> [<em>local-url</em>] ...</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td><code>DirectoryIndex index.html</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>server config, virtual host, directory, .htaccess</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Override" class="help">Override:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>Indexes</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>Base</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive </a></td><td>mod_dir</td></tr></table></td></tr></table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive">DirectoryIndex</code> directive sets the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive list of resources to look for, when the client requests an index
06ba4a61654b3763ad65f52283832ebf058fdf1cslive of the directory by specifying a / at the end of the a directory
06ba4a61654b3763ad65f52283832ebf058fdf1cslive name. <em>Local-url</em> is the (%-encoded) URL of a document on
06ba4a61654b3763ad65f52283832ebf058fdf1cslive the server relative to the requested directory; it is usually the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive name of a file in the directory. Several URLs may be given, in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive which case the server will return the first one that it finds. If
06ba4a61654b3763ad65f52283832ebf058fdf1cslive none of the resources exist and the <code>Indexes</code> option is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive set, the server will generate its own listing of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directory.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1csliveDirectoryIndex index.html
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>then a request for <code>http://myserver/docs/</code> would
06ba4a61654b3763ad65f52283832ebf058fdf1cslive return <code>http://myserver/docs/index.html</code> if it
06ba4a61654b3763ad65f52283832ebf058fdf1cslive exists, or would list the directory if it did not.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Note that the documents do not need to be relative to the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directory;</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>DirectoryIndex index.html index.txt /cgi-bin/index.pl</code></td></tr></table></blockquote>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be