mod_dir.xml revision 76570db19ca140d4e34641190638cb589ef77385
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<?xml version="1.0"?>
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_dir.xml.meta">
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<name>mod_dir</name>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<description>Provides for "trailing slash" redirects and
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive serving directory index files</description>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<status>Base</status>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<sourcefile>mod_dir.c</sourcefile>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<identifier>dir_module</identifier>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<summary>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The index of a directory can come from one of two sources:</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <ul>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <li>A file written by the user, typically called
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>index.html</code>. The <directive module="mod_dir"
6a7d71eb77725eb1b1091a94289696ab07946c7bslive >DirectoryIndex</directive> directive sets the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive name of this file. This is controlled by
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <module>mod_dir</module>.</li>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <li>Otherwise, a listing generated by the server. This is
6a7d71eb77725eb1b1091a94289696ab07946c7bslive provided by <module>mod_autoindex</module>.</li>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive </ul>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The two functions are separated so that you can completely
6a7d71eb77725eb1b1091a94289696ab07946c7bslive remove (or replace) automatic index generation should you want
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim to.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>A "trailing slash" redirect is issued when the server
6a7d71eb77725eb1b1091a94289696ab07946c7bslive receives a request for a URL
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>http://servername/foo/dirname</code> where
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>dirname</code> is a directory. Directories require a
6a7d71eb77725eb1b1091a94289696ab07946c7bslive trailing slash, so <module>mod_dir</module> issues a redirect to
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <code>http://servername/foo/dirname/</code>.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</summary>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<directivesynopsis>
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive<name>DirectoryIndex</name>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<description>List of resources to look for when the client requests
6a7d71eb77725eb1b1091a94289696ab07946c7bslivea directory</description>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<syntax>DirectoryIndex
b6d2c204c150843e48f6787c1090ae75b718896ecovener disabled | <var>local-url</var> [<var>local-url</var>] ...</syntax>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<default>DirectoryIndex index.html</default>
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd<contextlist><context>server config</context><context>virtual host</context>
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd<context>directory</context><context>.htaccess</context></contextlist>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<override>Indexes</override>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive<usage>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>The <directive>DirectoryIndex</directive> directive sets the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive list of resources to look for, when the client requests an index
1887c0b8ceab2c8d64a1e5b3aa512e77b86b49fayoshiki of the directory by specifying a / at the end of the directory
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd name. <var>Local-url</var> is the (%-encoded) URL of a document on
6a7d71eb77725eb1b1091a94289696ab07946c7bslive the server relative to the requested directory; it is usually the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive name of a file in the directory. Several URLs may be given, in
6a7d71eb77725eb1b1091a94289696ab07946c7bslive which case the server will return the first one that it finds. If
6a7d71eb77725eb1b1091a94289696ab07946c7bslive none of the resources exist and the <code>Indexes</code> option is
6a7d71eb77725eb1b1091a94289696ab07946c7bslive set, the server will generate its own listing of the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive directory.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd <example><title>Example</title>
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd DirectoryIndex index.html
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd </example>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
68ac503285e50f47ed404dcd7daaad8c6b99710bcovener <p>then a request for <code>http://example.com/docs/</code> would
68ac503285e50f47ed404dcd7daaad8c6b99710bcovener return <code>http://example.com/docs/index.html</code> if it
6a7d71eb77725eb1b1091a94289696ab07946c7bslive exists, or would list the directory if it did not.</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <p>Note that the documents do not need to be relative to the
6a7d71eb77725eb1b1091a94289696ab07946c7bslive directory;</p>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd DirectoryIndex index.html index.txt /cgi-bin/index.pl
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
f5cbf3a7818c08d2f19c04fdf4f47257eea7d3c6nd
6a7d71eb77725eb1b1091a94289696ab07946c7bslive <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>
63de18ba5e922ffaab500317d7d1d0ad6b27b7e2covener
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>A single argument of "disabled" prevents <module>mod_dir</module> from
e2d704f65ae715639ae9d21d98bbf19ebcad58ffhumbedooh searching for an index. An argument of "disabled" will be interpreted
b6d2c204c150843e48f6787c1090ae75b718896ecovener literally if it has any arguments before or after it, even if they are "disabled"
b6d2c204c150843e48f6787c1090ae75b718896ecovener as well.</p>
63de18ba5e922ffaab500317d7d1d0ad6b27b7e2covener
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor <p><strong>Note:</strong> Multiple <directive>DirectoryIndex</directive>
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor directives within the <a href="/sections.html"><em>same context</em></a> will add
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh to the list of resources to look for rather than replace:
1e54625c5f8d2ef6513949447c4f9cc7401120a3humbedooh </p>
1e54625c5f8d2ef6513949447c4f9cc7401120a3humbedooh <highlight language="config">
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh# Example A: Set index.html as an index page, then add index.php to that list as well.
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;Directory /foo&gt;
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex index.html
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex index.php
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;/Directory&gt;
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh# Example B: This is identical to example A, except it's done with a single directive.
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;Directory /foo&gt;
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex index.html index.php
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;/Directory&gt;
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh
066f5930841d824f2d8011b9abec9757e81e64e1humbedooh# Example C: To replace the list, you must explicitly reset it first:
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh# In this example, only index.php will remain as an index resource.
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;Directory /foo&gt;
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex index.html
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex disabled
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh DirectoryIndex index.php
efb7d0e919bad231c2147ae783cd12a2fe639577humbedooh&lt;/Directory&gt;
1e54625c5f8d2ef6513949447c4f9cc7401120a3humbedooh </highlight>
1e54625c5f8d2ef6513949447c4f9cc7401120a3humbedooh
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</usage>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive</directivesynopsis>
6a7d71eb77725eb1b1091a94289696ab07946c7bslive
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<directivesynopsis>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<name>DirectoryIndexRedirect</name>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<description>Configures an external redirect for directory indexes.
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener</description>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<syntax>DirectoryIndexRedirect on | off | permanent | temp | seeother |
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<var>3xx-code</var>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener</syntax>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<default>DirectoryIndexRedirect off</default>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<contextlist><context>server config</context><context>virtual host</context>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<context>directory</context><context>.htaccess</context></contextlist>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<override>Indexes</override>
39648a91fe21ca9a7c979a0eded8ba358925c0c6lgentis<compatibility>Available in version 2.3.14 and later</compatibility>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener<usage>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener <p>By default, the <directive>DirectoryIndex</directive> is selected
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener and returned transparently to the client. <directive
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener >DirectoryIndexRedirect</directive> causes an external redirect
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener to instead be issued.</p>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
76570db19ca140d4e34641190638cb589ef77385jailletc <p>The argument can be:</p>
650401e2cb916188d0e1a280dfa78dd67e24ce3bgryzor <ul>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><code>on</code>: issues a 302 redirection to the index resource.</li>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><code>off</code>: does not issue a redirection. This is the legacy behaviour of mod_dir.</li>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><code>permanent</code>: issues a 301 (permanent) redirection to the index resource.</li>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><code>temp</code>: this has the same effect as <code>on</code></li>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><code>seeother</code>: issues a 303 redirection (also known as "See Other") to the index resource.</li>
76570db19ca140d4e34641190638cb589ef77385jailletc <li><var>3xx-code</var>: issues a redirection marked by the chosen 3xx code.</li>
650401e2cb916188d0e1a280dfa78dd67e24ce3bgryzor </ul>
650401e2cb916188d0e1a280dfa78dd67e24ce3bgryzor
650401e2cb916188d0e1a280dfa78dd67e24ce3bgryzor
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener <example><title>Example</title>
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener DirectoryIndexRedirect on
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener </example>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener <p>A request for <code>http://example.com/docs/</code> would
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener return a temporary redirect to <code
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim >http://example.com/docs/index.html</code>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener if it exists.</p>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener</usage>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener</directivesynopsis>
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
c7a0eab564f789b5272019889e3dfafa3767aa2bcovener
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<directivesynopsis>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<name>DirectorySlash</name>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<description>Toggle trailing slash redirects on or off</description>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<syntax>DirectorySlash On|Off</syntax>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<default>DirectorySlash On</default>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<contextlist><context>server config</context><context>virtual host</context>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<context>directory</context><context>.htaccess</context></contextlist>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<override>Indexes</override>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
3b2d0dc9701458b42e573190ffe7344315d7bd31nd<usage>
6843492434af6aa75e82365efca60a7c369f8c18rbowen <p>The <directive>DirectorySlash</directive> directive determines whether
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <module>mod_dir</module> should fixup URLs pointing to a directory or
3b2d0dc9701458b42e573190ffe7344315d7bd31nd not.</p>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <p>Typically if a user requests a resource without a trailing slash, which
3b2d0dc9701458b42e573190ffe7344315d7bd31nd points to a directory, <module>mod_dir</module> redirects him to the same
90361ddfb3a8abaa0f8fb1729732062c78d8dc50niq resource, but <em>with</em> trailing slash for some good reasons:</p>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <ul>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <li>The user is finally requesting the canonical URL of the resource</li>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <li><module>mod_autoindex</module> works correctly. Since it doesn't emit
3b2d0dc9701458b42e573190ffe7344315d7bd31nd the path in the link, it would point to the wrong path.</li>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <li><directive module="mod_dir">DirectoryIndex</directive> will be evaluated
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <em>only</em> for directories requested with trailing slash.</li>
571d9bf2dccc0cb3d944fd06a96218ab49899513nd <li>Relative URL references inside html pages will work correctly.</li>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd </ul>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
89a53d13a4bbd045c0001a5d47d879613ca55527rbowen <p>If you don't want this effect <em>and</em> the reasons above don't
89a53d13a4bbd045c0001a5d47d879613ca55527rbowen apply to you, you can turn off the redirect as shown below. However,
89a53d13a4bbd045c0001a5d47d879613ca55527rbowen be aware that there are possible security implications to doing
89a53d13a4bbd045c0001a5d47d879613ca55527rbowen this.</p>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh# see security warning below!
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh&lt;Location /some/path&gt;
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh DirectorySlash Off
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh SetHandler some-handler
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh&lt;/Location&gt;
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <note type="warning"><title>Security Warning</title>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <p>Turning off the trailing slash redirect may result in an information
3b2d0dc9701458b42e573190ffe7344315d7bd31nd disclosure. Consider a situation where <module>mod_autoindex</module> is
3b2d0dc9701458b42e573190ffe7344315d7bd31nd active (<code>Options +Indexes</code>) and <directive module="mod_dir"
3b2d0dc9701458b42e573190ffe7344315d7bd31nd >DirectoryIndex</directive> is set to a valid resource (say,
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <code>index.html</code>) and there's no other special handler defined for
3b2d0dc9701458b42e573190ffe7344315d7bd31nd that URL. In this case a request with a trailing slash would show the
3b2d0dc9701458b42e573190ffe7344315d7bd31nd <code>index.html</code> file. <strong>But a request without trailing slash
3b2d0dc9701458b42e573190ffe7344315d7bd31nd would list the directory contents</strong>.</p>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd </note>
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor <p>Also note that some browsers may erroneously change POST requests into GET
4667597c48824aef177e51c51d0664afe5b460a9humbedooh (thus discarding POST data) when a redirect is issued.</p>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd</usage>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd</directivesynopsis>
a3de986b8f062c83ceda21a7389787712214b02cniq<directivesynopsis>
80370e62044bea458bcd0545c59cb864ed117b04niq<name>FallbackResource</name>
a3de986b8f062c83ceda21a7389787712214b02cniq<description>Define a default URL for requests that don't map to a file</description>
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor<syntax>FallbackResource disabled | <var>local-url</var></syntax>
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor<default>disabled - httpd will return 404 (Not Found)</default>
a3de986b8f062c83ceda21a7389787712214b02cniq<contextlist><context>server config</context><context>virtual host</context>
a3de986b8f062c83ceda21a7389787712214b02cniq<context>directory</context><context>.htaccess</context></contextlist>
a3de986b8f062c83ceda21a7389787712214b02cniq<override>Indexes</override>
76570db19ca140d4e34641190638cb589ef77385jailletc<compatibility>The <code>disabled</code> argument is available in version 2.4.4 and
76570db19ca140d4e34641190638cb589ef77385jailletclater</compatibility>
a3de986b8f062c83ceda21a7389787712214b02cniq<usage>
a3de986b8f062c83ceda21a7389787712214b02cniq <p>Use this to set a handler for any URL that doesn't map to anything
a3de986b8f062c83ceda21a7389787712214b02cniq in your filesystem, and would otherwise return HTTP 404 (Not Found).
a3de986b8f062c83ceda21a7389787712214b02cniq For example</p>
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh FallbackResource /not-404.php
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
a3de986b8f062c83ceda21a7389787712214b02cniq <p>will cause requests for non-existent files to be handled by
561dfbf9bb1f0799ca6676e3475703959d3032adniq <code>not-404.php</code>, while requests for files that exist
a3de986b8f062c83ceda21a7389787712214b02cniq are unaffected.</p>
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen <p>It is frequently desirable to have a single file or resource
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen handle all requests to a particular directory, except those requests
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen that correspond to an existing file or script. This is often
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen referred to as a 'front controller.'</p>
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen <p>In earlier versions of httpd, this effect typically required
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen <module>mod_rewrite</module>, and the use of the <code>-f</code> and
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen <code>-d</code> tests for file and directory existence. This now
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen requires only one line of configuration.</p>
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh FallbackResource /index.php
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen <p>Existing files, such as images, css files, and so on, will be
9750e43c0e01cbb2cda812fef5f341de512f03f5rbowen served normally.</p>
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor <p>Use the <code>disabled</code> argument to disable that feature
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor if inheritance from a parent directory is not desired.</p>
d7a89def7072ad8dce0b6dc773e5364f2bc81ee5igalic <p>In a sub-URI, such as <em>http://example.com/blog/</em> this
d7a89def7072ad8dce0b6dc773e5364f2bc81ee5igalic <em>sub-URI</em> has to be supplied as <var>local-url</var>:</p>
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh <highlight language="config">
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh&lt;Directory /web/example.com/htdocs/blog&gt;
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh FallbackResource /blog/index.php
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor&lt;/Directory&gt;
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor&lt;Directory /web/example.com/htdocs/blog/images&gt;
02c8e4c50471e515a88620bddba4d15ad2384f8bgryzor FallbackResource disabled
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh&lt;/Directory&gt;
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh </highlight>
a3de986b8f062c83ceda21a7389787712214b02cniq</usage>
a3de986b8f062c83ceda21a7389787712214b02cniq</directivesynopsis>
111436a32ba1254291e4883292fb116d15fe8f64covener<directivesynopsis>
111436a32ba1254291e4883292fb116d15fe8f64covener<name>DirectoryCheckHandler</name>
111436a32ba1254291e4883292fb116d15fe8f64covener<description>Toggle how this module responds when another handler is configured</description>
111436a32ba1254291e4883292fb116d15fe8f64covener<syntax>DirectoryCheckHandler On|Off</syntax>
c71d76178cda93ed4f5ae4098b03f1533aede614covener<default>DirectoryCheckHandler Off</default>
111436a32ba1254291e4883292fb116d15fe8f64covener<contextlist><context>server config</context><context>virtual host</context>
111436a32ba1254291e4883292fb116d15fe8f64covener<context>directory</context><context>.htaccess</context></contextlist>
111436a32ba1254291e4883292fb116d15fe8f64covener<override>Indexes</override>
111436a32ba1254291e4883292fb116d15fe8f64covener<compatibility>Available in 2.4.8 and later. Releases prior to 2.4 implicitly
c71d76178cda93ed4f5ae4098b03f1533aede614coveneract as if "DirectoryCheckHandler ON" was specified.</compatibility>
111436a32ba1254291e4883292fb116d15fe8f64covener<usage>
111436a32ba1254291e4883292fb116d15fe8f64covener <p>The <directive>DirectoryCheckHandler</directive> directive determines
111436a32ba1254291e4883292fb116d15fe8f64covener whether <module>mod_dir</module> should check for directory indexes or
111436a32ba1254291e4883292fb116d15fe8f64covener add trailing slashes when some other handler has been configured for
111436a32ba1254291e4883292fb116d15fe8f64covener the current URL. Handlers can be set by directives such as
2fdf06de61489ca6758f46a088242f7c768c918fcovener <directive module="core">SetHandler</directive> or by other modules at
2fdf06de61489ca6758f46a088242f7c768c918fcovener runtime. </p>
111436a32ba1254291e4883292fb116d15fe8f64covener
111436a32ba1254291e4883292fb116d15fe8f64covener <p> In releases prior to 2.4, this module did not take any action if any
111436a32ba1254291e4883292fb116d15fe8f64covener other handler was configured for a URL. This allows directory indexes to
111436a32ba1254291e4883292fb116d15fe8f64covener be served even when a <directive>SetHandler</directive> directive is
111436a32ba1254291e4883292fb116d15fe8f64covener specified for an entire directory, but it can also result in some conflicts
2fdf06de61489ca6758f46a088242f7c768c918fcovener with other modules.</p>
111436a32ba1254291e4883292fb116d15fe8f64covener</usage>
111436a32ba1254291e4883292fb116d15fe8f64covener</directivesynopsis>
3b2d0dc9701458b42e573190ffe7344315d7bd31nd
7db9f691a00ead175b03335457ca296a33ddf31bnd</modulesynopsis>