mod_dir.html.en revision f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd This file is generated from xml source: DO NOT EDIT
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd --><title>mod_dir - Apache HTTP Server</title><link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="/images/favicon.ico" rel="shortcut icon" /></head><body><div id="page-header"><p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="/images/feather.gif" /></div><div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div><div id="page-content"><div id="preamble"><h1>Apache Module mod_dir</h1><table class="module"><tr><th><a href="module-dict.html#Description">Description:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd serving directory index files</td></tr><tr><th><a href="module-dict.html#Status">Status:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>Base</td></tr><tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>dir_module</td></tr><tr><th><a href="module-dict.html#SourceFile">Source�File:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <p>The index of a directory can come from one of two sources:</p>
27e52281f1522522b170cafc76b08b58aa70ccaand <li>A file written by the user, typically called
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <code>index.html</code>. The <code class="directive"><a href="#directoryindex">DirectoryIndex</a></code> directive sets the
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd name of this file. This is controlled by
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code>.</li>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <li>Otherwise, a listing generated by the server. This is
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd provided by <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code>.</li>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <p>The two functions are separated so that you can completely
d28579afd45cc42da1422161721fb12f9cf366b9nd remove (or replace) automatic index generation should you want
1ac39787115a288f5e848344b1b1e8dccb1c58f1nd <p>A "trailing slash" redirect is issued when the server
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd receives a request for a URL
b03f9485e6dfcf9326e6122f91eaa1ced8939818jim <code>dirname</code> is a directory. Directories require a
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd trailing slash, so <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code> issues a redirect to
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd</div><div id="quickview"><h3 class="directives">Directives</h3><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#directoryindex">DirectoryIndex</a></li>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd</ul></div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div><div class="directive-section"><h2><a name="DirectoryIndex" id="DirectoryIndex">DirectoryIndex</a> <a name="directoryindex" id="directoryindex">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>List of resources to look for when the client requests
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnda directory</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <var>local-url</var> [<var>local-url</var>] ...</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td><code>DirectoryIndex index.html</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>Indexes</td></tr><tr><th><a href="directive-dict.html#Status">Status:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd </a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <p>The <code class="directive">DirectoryIndex</code> directive sets the
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd list of resources to look for, when the client requests an index
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd of the directory by specifying a / at the end of the a directory
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd name. <var>Local-url</var> is the (%-encoded) URL of a document on
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd the server relative to the requested directory; it is usually the
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd name of a file in the directory. Several URLs may be given, in
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd which case the server will return the first one that it finds. If
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd none of the resources exist and the <code>Indexes</code> option is
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd set, the server will generate its own listing of the
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd directory.</p>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd DirectoryIndex index.html
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <p>then a request for <code>http://myserver/docs/</code> would
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd return <code>http://myserver/docs/index.html</code> if it
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd exists, or would list the directory if it did not.</p>
f68d1146896d2744b5ad04b445b08724c4b7fa67rbowen <p>Note that the documents do not need to be relative to the
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd directory;</p>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd executed if neither <code>index.html</code> or <code>index.txt</code>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd existed in a directory.</p>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd</div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p><p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div></body></html>