mod_dir.xml revision 6a7d71eb77725eb1b1091a94289696ab07946c7b
74086452b5093fa1a58446034c6ddfd67dab5651kess<?xml version="1.0"?>
74086452b5093fa1a58446034c6ddfd67dab5651kess<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
74086452b5093fa1a58446034c6ddfd67dab5651kess<modulesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess<name>mod_dir</name>
74086452b5093fa1a58446034c6ddfd67dab5651kess<description>Provides for "trailing slash" redirects and
74086452b5093fa1a58446034c6ddfd67dab5651kess serving directory index files.</description>
74086452b5093fa1a58446034c6ddfd67dab5651kess<status>Base</status>
74086452b5093fa1a58446034c6ddfd67dab5651kess<sourcefile>mod_dir.c</sourcefile>
74086452b5093fa1a58446034c6ddfd67dab5651kess<identifier>dir_module</identifier>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
2e545ce2450a9953665f701bb05350f0d3f26275nd<summary>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen <p>The index of a directory can come from one of two sources:</p>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
74086452b5093fa1a58446034c6ddfd67dab5651kess <ul>
74086452b5093fa1a58446034c6ddfd67dab5651kess <li>A file written by the user, typically called
74086452b5093fa1a58446034c6ddfd67dab5651kess <code>index.html</code>. The <directive module="mod_dir"
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen >DirectoryIndex</directive> directive sets the
3f08db06526d6901aa08c110b5bc7dde6bc39905nd name of this file. This is controlled by
74086452b5093fa1a58446034c6ddfd67dab5651kess <module>mod_dir</module>.</li>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess <li>Otherwise, a listing generated by the server. This is
3f08db06526d6901aa08c110b5bc7dde6bc39905nd provided by <module>mod_autoindex</module>.</li>
74086452b5093fa1a58446034c6ddfd67dab5651kess </ul>
74086452b5093fa1a58446034c6ddfd67dab5651kess <p>The two functions are separated so that you can completely
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd remove (or replace) automatic index generation should you want
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd to.</p>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd
fac8c35bfb158112226ab43ddf84d59daca5dc30nd <p>A "trailing slash" redirect is issued when the server
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung receives a request for a URL
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd <code>http://servername/foo/dirname</code> where
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem <code>dirname</code> is a directory. Directories require a
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem trailing slash, so <module>mod_dir</module> issues a redirect to
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem <code>http://servername/foo/dirname/</code>.</p>
74086452b5093fa1a58446034c6ddfd67dab5651kess</summary>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess<directivesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess<description>List of resources to look for when the client requests
74086452b5093fa1a58446034c6ddfd67dab5651kessa directory</description>
74086452b5093fa1a58446034c6ddfd67dab5651kess<name>DirectoryIndex</name>
74086452b5093fa1a58446034c6ddfd67dab5651kess<syntax>DirectoryIndex
d9eaa83c63eb571d519610f7e9a1d73360ba4d32nd <em>local-url</em> [<em>local-url</em>] ...</syntax>
b9f522ae1c0ed2bf3fc4444245bf28b2e2449a65nd<default>DirectoryIndex index.html</default>
74086452b5093fa1a58446034c6ddfd67dab5651kess<contextlist><context>server config</context>
74086452b5093fa1a58446034c6ddfd67dab5651kess<context>virtual host</context>
b9f522ae1c0ed2bf3fc4444245bf28b2e2449a65nd<context>directory</context>
74086452b5093fa1a58446034c6ddfd67dab5651kess<context>.htaccess</context>
c38e2a97e43fc69b22f6b03c6d2f60e3bd705f89sf</contextlist>
74086452b5093fa1a58446034c6ddfd67dab5651kess<override>Indexes</override>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess<usage>
b9f522ae1c0ed2bf3fc4444245bf28b2e2449a65nd <p>The <directive>DirectoryIndex</directive> directive sets the
74086452b5093fa1a58446034c6ddfd67dab5651kess list of resources to look for, when the client requests an index
74086452b5093fa1a58446034c6ddfd67dab5651kess of the directory by specifying a / at the end of the a directory
74086452b5093fa1a58446034c6ddfd67dab5651kess name. <em>Local-url</em> is the (%-encoded) URL of a document on
74086452b5093fa1a58446034c6ddfd67dab5651kess the server relative to the requested directory; it is usually the
74086452b5093fa1a58446034c6ddfd67dab5651kess name of a file in the directory. Several URLs may be given, in
74086452b5093fa1a58446034c6ddfd67dab5651kess which case the server will return the first one that it finds. If
74086452b5093fa1a58446034c6ddfd67dab5651kess none of the resources exist and the <code>Indexes</code> option is
b92b52b4e80be062c6ba4549570cf8de360b1c86nd set, the server will generate its own listing of the
74086452b5093fa1a58446034c6ddfd67dab5651kess directory.</p>
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh
74086452b5093fa1a58446034c6ddfd67dab5651kess<example><title>Example</title>
74086452b5093fa1a58446034c6ddfd67dab5651kessDirectoryIndex index.html
74086452b5093fa1a58446034c6ddfd67dab5651kess</example>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess <p>then a request for <code>http://myserver/docs/</code> would
74086452b5093fa1a58446034c6ddfd67dab5651kess return <code>http://myserver/docs/index.html</code> if it
74086452b5093fa1a58446034c6ddfd67dab5651kess exists, or would list the directory if it did not.</p>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess <p>Note that the documents do not need to be relative to the
74086452b5093fa1a58446034c6ddfd67dab5651kess directory;</p>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess<example>DirectoryIndex index.html index.txt /cgi-bin/index.pl</example>
74086452b5093fa1a58446034c6ddfd67dab5651kess <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be
74086452b5093fa1a58446034c6ddfd67dab5651kess executed if neither <code>index.html</code> or
74086452b5093fa1a58446034c6ddfd67dab5651kess <code>index.txt</code> existed in a directory.</p>
74086452b5093fa1a58446034c6ddfd67dab5651kess</usage>
74086452b5093fa1a58446034c6ddfd67dab5651kess</directivesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess
74086452b5093fa1a58446034c6ddfd67dab5651kess</modulesynopsis>