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