<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <
meta name="generator" content="HTML Tidy, see www.w3.org" />
<
title>Apache module mod_dir</
title>
<!-- Background white, links blue (unvisited), navy (visited), red (active) --> <
body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#000080" alink="#FF0000">
<
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 />
rel="Help"><
strong>Source File:</
strong></
a>
mod_dir.c<
br />
rel="Help"><
strong>Module Identifier:</
strong></
a>
The index of a directory can come from one of two sources:
<
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
The two functions are separated so that you can completely
remove (or replace) automatic index generation should you want
<
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
<
li><
a href="#directoryindex">DirectoryIndex</
a></
li>
<
h2><
a id="directoryindex" name="directoryindex">DirectoryIndex</
a> directive</
h2>
<!--%plaintext <?INDEX {\tt DirectoryIndex} directive> --> rel="Help"><
strong>Syntax:</
strong></
a> DirectoryIndex
<
em>local-url</
em> [<
em>local-url</
em>] ...<
br />
rel="Help"><
strong>Default:</
strong></
a> <
code>DirectoryIndex
rel="Help"><
strong>Context:</
strong></
a> server config, virtual
host, directory, .htaccess<
br />
rel="Help"><
strong>Override:</
strong></
a> Indexes<
br />
rel="Help"><
strong>Status:</
strong></
a> Base<
br />
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
exists, or would list the directory if it did not.
<
p>Note that the documents do not need to be relative to the
<
code>
index.txt</
code> existed in a directory.