mod_dir.html revision 618d2847990e59c6fa82b74b160453e1048a2957
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<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>
is compiled in by default. It provides for "trailing slash" redirects and
serving directory index files.
<h2>Summary</h2>
The index of a directory can come from one of two sources:
<UL>
The <A HREF="#directoryindex">DirectoryIndex</A> directive sets
the name of this file.
This is controlled by <CODE>mod_dir</CODE>.
<LI>Otherwise, a listing generated by the server. This is provided by
</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
<SAMP>dirname</SAMP> is a directory. Directories require a trailing
slash, so <CODE>mod_dir</CODE> issues a redirect to
<h2>Directives</h2>
<MENU>
<LI><A HREF="#directoryindex">DirectoryIndex</A>
</MENU>
<HR>
<A name="directoryindex"><h2>DirectoryIndex</h2></A>
<!--%plaintext <?INDEX {\tt DirectoryIndex} directive> -->
<A
HREF="directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> DirectoryIndex <EM>local-url local-url ...</EM><BR>
<A
HREF="directive-dict.html#Default"
REL="Help"
<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>
Example:
<BLOCKQUOTE><CODE>
DirectoryIndex index.html
</CODE></BLOCKQUOTE>
the directory if it did not. <P>
Note that the documents do not need to be relative to the directory;
<BLOCKQUOTE><CODE>
a directory.<P><HR>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>