mirror of
https://github.com/apache/httpd.git
synced 2025-08-26 05:42:34 +03:00
CVS files are copies of the mod_dir files so that we retain history in both places. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@78566 13f79535-47bb-0310-9956-ffa450edef68
86 lines
3.1 KiB
HTML
86 lines
3.1 KiB
HTML
<!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>
|
|
|
|
This module is contained in the <code>mod_dir.c</code> file, and
|
|
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>
|
|
<li>A file written by the user, typically called <code>index.html</code>.
|
|
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
|
|
<a href="mod_autoindex.html"><code>mod_autoindex</code></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>http://servername/foo/dirname</SAMP> where
|
|
<SAMP>dirname</SAMP> is a directory. Directories require a trailing
|
|
slash, so <code>mod_dir</code> issues a redirect to
|
|
<SAMP>http://servername/foo/dirname/</SAMP>.
|
|
|
|
<h2>Directives</h2>
|
|
|
|
<menu>
|
|
<li><A HREF="#directoryindex">DirectoryIndex</A>
|
|
</menu>
|
|
<hr>
|
|
|
|
<A name="directoryindex"><h2>DirectoryIndex</h2></A>
|
|
<!--%plaintext <?INDEX {\tt DirectoryIndex} directive> -->
|
|
<strong>Syntax:</strong> DirectoryIndex <em>local-url local-url ...</em><br>
|
|
<strong>Default:</strong> <code>DirectoryIndex index.html</code><br>
|
|
<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
|
|
<Strong>Override:</strong> Indexes<br>
|
|
<strong>Status:</strong> Base<br>
|
|
<strong>Module:</strong> 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>
|
|
then a request for <code>http://myserver/docs/</code> would return
|
|
<code>http://myserver/docs/index.html</code> if it exists, or would list
|
|
the directory if it did not. <p>
|
|
|
|
Note that the documents do not need to be relative to the directory;
|
|
<blockquote><code>
|
|
DirectoryIndex index.html index.txt /cgi-bin/index.pl</code></blockquote>
|
|
would cause the CGI script <code>/cgi-bin/index.pl</code> to be executed
|
|
if neither <code>index.html</code> or <code>index.txt</code> existed in
|
|
a directory.<p><hr>
|
|
|
|
<!--#include virtual="footer.html" -->
|
|
</BODY>
|
|
</HTML>
|
|
|