]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_dir.xml
add $Revision$ keyword
[apache] / docs / manual / mod / mod_dir.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $Revision: 1.9 $ -->
5
6 <!--
7  Copyright 2002-2004 The Apache Software Foundation
8
9  Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12
13      http://www.apache.org/licenses/LICENSE-2.0
14
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20 -->
21
22 <modulesynopsis metafile="mod_dir.xml.meta">
23 <name>mod_dir</name>
24 <description>Provides for "trailing slash" redirects and
25     serving directory index files</description>
26 <status>Base</status>
27 <sourcefile>mod_dir.c</sourcefile>
28 <identifier>dir_module</identifier>
29
30 <summary>
31     <p>The index of a directory can come from one of two sources:</p>
32
33     <ul>
34       <li>A file written by the user, typically called
35       <code>index.html</code>. The <directive module="mod_dir"
36       >DirectoryIndex</directive> directive sets the
37       name of this file. This is controlled by
38       <module>mod_dir</module>.</li>
39
40       <li>Otherwise, a listing generated by the server. This is
41       provided by <module>mod_autoindex</module>.</li>
42     </ul>
43     <p>The two functions are separated so that you can completely
44     remove (or replace) automatic index generation should you want
45     to.</p> 
46
47     <p>A "trailing slash" redirect is issued when the server
48     receives a request for a URL
49     <code>http://servername/foo/dirname</code> where
50     <code>dirname</code> is a directory. Directories require a
51     trailing slash, so <module>mod_dir</module> issues a redirect to
52     <code>http://servername/foo/dirname/</code>.</p>
53 </summary>
54
55 <directivesynopsis>
56 <name>DirectoryIndex</name>
57 <description>List of resources to look for when the client requests
58 a directory</description>
59 <syntax>DirectoryIndex
60     <var>local-url</var> [<var>local-url</var>] ...</syntax>
61 <default>DirectoryIndex index.html</default>
62 <contextlist><context>server config</context><context>virtual host</context>
63 <context>directory</context><context>.htaccess</context></contextlist>
64 <override>Indexes</override>
65
66 <usage>
67     <p>The <directive>DirectoryIndex</directive> directive sets the
68     list of resources to look for, when the client requests an index
69     of the directory by specifying a / at the end of the directory
70     name.  <var>Local-url</var> is the (%-encoded) URL of a document on
71     the server relative to the requested directory; it is usually the
72     name of a file in the directory. Several URLs may be given, in
73     which case the server will return the first one that it finds.  If
74     none of the resources exist and the <code>Indexes</code> option is
75     set, the server will generate its own listing of the
76     directory.</p>
77
78     <example><title>Example</title>
79       DirectoryIndex index.html
80     </example>
81
82     <p>then a request for <code>http://myserver/docs/</code> would
83     return <code>http://myserver/docs/index.html</code> if it
84     exists, or would list the directory if it did not.</p>
85
86     <p>Note that the documents do not need to be relative to the
87     directory;</p>
88
89     <example>
90       DirectoryIndex index.html index.txt  /cgi-bin/index.pl
91     </example>
92
93     <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be
94     executed if neither <code>index.html</code> or <code>index.txt</code>
95     existed in a directory.</p>
96 </usage>
97 </directivesynopsis>
98
99 </modulesynopsis>