mod_dir.xml revision 6a7d71eb77725eb1b1091a94289696ab07946c7b
74086452b5093fa1a58446034c6ddfd67dab5651kess<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
74086452b5093fa1a58446034c6ddfd67dab5651kess<modulesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess<description>Provides for "trailing slash" redirects and
74086452b5093fa1a58446034c6ddfd67dab5651kess serving directory index files.</description>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen <p>The index of a directory can come from one of two sources:</p>
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 <li>Otherwise, a listing generated by the server. This is
74086452b5093fa1a58446034c6ddfd67dab5651kess <p>The two functions are separated so that you can completely
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd remove (or replace) automatic index generation should you want
fac8c35bfb158112226ab43ddf84d59daca5dc30nd <p>A "trailing slash" redirect is issued when the server
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung receives a request for a URL
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem <code>dirname</code> is a directory. Directories require a
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem trailing slash, so <module>mod_dir</module> issues a redirect to
74086452b5093fa1a58446034c6ddfd67dab5651kess<directivesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess<description>List of resources to look for when the client requests
74086452b5093fa1a58446034c6ddfd67dab5651kessa directory</description>
74086452b5093fa1a58446034c6ddfd67dab5651kess<syntax>DirectoryIndex
c38e2a97e43fc69b22f6b03c6d2f60e3bd705f89sf</contextlist>
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>
74086452b5093fa1a58446034c6ddfd67dab5651kessDirectoryIndex index.html
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 <p>Note that the documents do not need to be relative to the
74086452b5093fa1a58446034c6ddfd67dab5651kess directory;</p>
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</directivesynopsis>
74086452b5093fa1a58446034c6ddfd67dab5651kess</modulesynopsis>