mod_dir.html revision 2eaf662cbc81e823e8d9aeb8d54e69e63032493e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache module mod_dir</title>
</head>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#000080" alink="#FF0000">
<!--#include virtual="header.html" -->
<h1 align="CENTER">Module mod_dir</h1>
<p>This module provides for "trailing slash" redirects and
serving directory index files.</p>
rel="Help"><strong>Status:</strong></a> Base<br />
<a href="module-dict.html#SourceFile"
<a href="module-dict.html#ModuleIdentifier"
rel="Help"><strong>Module Identifier:</strong></a>
dir_module</p>
<h2>Summary</h2>
The index of a directory can come from one of two sources:
<ul>
<li>A file written by the user, typically called
href="#directoryindex">DirectoryIndex</a> directive sets the
name of this file. This is controlled by
<code>mod_dir</code>.</li>
<li>Otherwise, a listing generated by the server. This is
provided by <a
</ul>
The two functions are separated so that you can completely
remove (or replace) automatic index generation should you want
to.
<p>A "trailing slash" redirect is issued when the server
receives a request for a URL
<samp>dirname</samp> is a directory. Directories require a
trailing slash, so <code>mod_dir</code> issues a redirect to
<h2>Directives</h2>
<ul>
<li><a href="#directoryindex">DirectoryIndex</a></li>
</ul>
<hr />
<h2><a id="directoryindex"
name="directoryindex">DirectoryIndex</a> directive</h2>
<!--%plaintext <?INDEX {\tt DirectoryIndex} directive> -->
<a href="directive-dict.html#Syntax"
rel="Help"><strong>Syntax:</strong></a> DirectoryIndex
<em>local-url</em> [<em>local-url</em>] ...<br />
<a href="directive-dict.html#Default"
rel="Help"><strong>Default:</strong></a> <code>DirectoryIndex
<a href="directive-dict.html#Context"
rel="Help"><strong>Context:</strong></a> server config, virtual
host, directory, .htaccess<br />
<a href="directive-dict.html#Override"
rel="Help"><strong>Override:</strong></a> Indexes<br />
<a href="directive-dict.html#Status"
rel="Help"><strong>Status:</strong></a> Base<br />
<a href="directive-dict.html#Module"
rel="Help"><strong>Module:</strong></a> mod_dir
<p>The DirectoryIndex directive sets the list of resources to
look for, when the client requests an index of the directory by
specifying a / at the end of the a directory name.
<em>Local-url</em> is the (%-encoded) URL of a document on the
server relative to the requested directory; it is usually the
name of a file in the directory. Several URLs may be given, in
which case the server will return the first one that it finds.
If none of the resources exist and the <code>Indexes</code>
option is set, the server will generate its own listing of the
directory.</p>
<p>Example:</p>
<blockquote>
</blockquote>
exists, or would list the directory if it did not.
<p>Note that the documents do not need to be relative to the
directory;</p>
<blockquote>
</blockquote>
<p><!--#include virtual="footer.html" -->
</p>
</body>
</html>