mod_dir.xml revision 5d01f40ffd657dd2ac567aacd93cabd162ddfa79
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews<!-- $LastChangedRevision$ -->
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews Licensed to the Apache Software Foundation (ASF) under one or more
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews contributor license agreements. See the NOTICE file distributed with
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews this work for additional information regarding copyright ownership.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews The ASF licenses this file to You under the Apache License, Version 2.0
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews (the "License"); you may not use this file except in compliance with
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews the License. You may obtain a copy of the License at
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt Unless required by applicable law or agreed to in writing, software
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt distributed under the License is distributed on an "AS IS" BASIS,
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt See the License for the specific language governing permissions and
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt limitations under the License.
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt<description>Provides for "trailing slash" redirects and
12178c86525332bb0ab66155feb61fbf32eca6acEvan Hunt serving directory index files</description>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <p>The index of a directory can come from one of two sources:</p>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <li>A file written by the user, typically called
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <code>index.html</code>. The <directive module="mod_dir"
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt >DirectoryIndex</directive> directive sets the
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt name of this file. This is controlled by
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 <li>Otherwise, a listing generated by the server. This is
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <p>The two functions are separated so that you can completely
71ba75c604df3604673232828a68bb28c420e698Mark Andrews remove (or replace) automatic index generation should you want
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt <p>A "trailing slash" redirect is issued when the server
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt receives a request for a URL
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt <code>dirname</code> is a directory. Directories require a
71ba75c604df3604673232828a68bb28c420e698Mark Andrews trailing slash, so <module>mod_dir</module> issues a redirect to
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt<directivesynopsis>
31a641171249300e29a02a6a01aa32c2af875cadEvan Hunt<description>List of resources to look for when the client requests
31a641171249300e29a02a6a01aa32c2af875cadEvan Hunta directory</description>
71ba75c604df3604673232828a68bb28c420e698Mark Andrews<syntax>DirectoryIndex
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 disabled | <var>local-url</var> [<var>local-url</var>] ...</syntax>
71ba75c604df3604673232828a68bb28c420e698Mark Andrews<contextlist><context>server config</context><context>virtual host</context>
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉<context>directory</context><context>.htaccess</context></contextlist>
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 <p>The <directive>DirectoryIndex</directive> directive sets the
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 list of resources to look for, when the client requests an index
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 of the directory by specifying a / at the end of the directory
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt name. <var>Local-url</var> is the (%-encoded) URL of a document on
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt the server relative to the requested directory; it is usually the
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt name of a file in the directory. Several URLs may be given, in
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt which case the server will return the first one that it finds. If
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt none of the resources exist and the <code>Indexes</code> option is
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt set, the server will generate its own listing of the
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt directory.</p>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt DirectoryIndex index.html
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt </highlight>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <p>then a request for <code>http://example.com/docs/</code> would
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt return <code>http://example.com/docs/index.html</code> if it
620508359f9bb21cd5df7fdf2e6f4677903fb539Mark Andrews exists, or would list the directory if it did not.</p>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <p>Note that the documents do not need to be relative to the
97725b410a7a65cd300028996b01960393532822Mark Andrews directory;</p>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt DirectoryIndex index.html index.txt /cgi-bin/index.pl
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt </highlight>
8c5482b3ea502276bff2ce66b3de7265c81e8b37Evan Hunt <p>would cause the CGI script <code>/cgi-bin/index.pl</code> to be
0f66aced2640d964aeb6db41210711ba0640d7f2Evan Hunt executed if neither <code>index.html</code> or <code>index.txt</code>
71ba75c604df3604673232828a68bb28c420e698Mark Andrews existed in a directory.</p>
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt <p>A single argument of "disabled" prevents <module>mod_dir</module> from
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt searching for an index. An argument of "disabled" will be interpreted
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt literally if it has any arguments before or after it, even if they are "disabled"
ca42dcc0686fefd3db202edab80e5adb09d6add5Evan Hunt as well.</p>
DirectoryIndex index.html
DirectoryIndex index.php
# In this example, only index.php will remain as an index resource.
DirectoryIndex index.html
DirectoryIndex index.php
<li><code>seeother</code>: issues a 303 redirection (also known as "See Other") to the index resource.</li>
FallbackResource /not-404.php
FallbackResource /index.php