literally if it has any arguments before or after it, even if they are "disabled"
as well.</p>
- <p><strong>Note:</strong> Multiple <directive>DirectoryIndex</directive>
- directives within the <a href="../sections.html"><em>same context</em></a> will add
+ <p><strong>Note:</strong> Multiple <directive>DirectoryIndex</directive>
+ directives within the <a href="../sections.html"><em>same context</em></a> will add
to the list of resources to look for rather than replace:
</p>
<highlight language="config">
# Example A: Set index.html as an index page, then add index.php to that list as well.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html
DirectoryIndex index.php
</Directory>
# Example B: This is identical to example A, except it's done with a single directive.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html index.php
</Directory>
-# Example C: To replace the list, you must explicitly do so:
+# Example C: To replace the list, you must explicitly reset it first:
# In this example, only index.php will remain as an index resource.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html
DirectoryIndex disabled
DirectoryIndex index.php
>DirectoryIndexRedirect</directive> causes an external redirect
to instead be issued.</p>
+ <p>The argument can be:</p>
+ <ul>
+ <li><code>on</code>: issues a 302 redirection to the index resource.</li>
+ <li><code>off</code>: does not issue a redirection. This is the legacy behaviour of mod_dir.</li>
+ <li><code>permanent</code>: issues a 301 (permanent) redirection to the index resource.</li>
+ <li><code>temp</code>: this has the same effect as <code>on</code></li>
+ <li><code>seeother</code>: issues a 303 redirection (also known as "See Other") to the index resource.</li>
+ <li><var>3xx-code</var>: issues a redirection marked by the chosen 3xx code.</li>
+ </ul>
+
+
<example><title>Example</title>
<highlight language="config">
DirectoryIndexRedirect on
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context></contextlist>
<override>Indexes</override>
-<compatibility>Available in version 2.0.51 and later</compatibility>
<usage>
<p>The <directive>DirectorySlash</directive> directive determines whether
<highlight language="config">
# see security warning below!
-<Location /some/path>
+<Location "/some/path">
DirectorySlash Off
SetHandler some-handler
</Location>
<code>index.html</code> file. <strong>But a request without trailing slash
would list the directory contents</strong>.</p>
</note>
- <p>Also note that some browsers may erroneously change POST requests into GET
+ <p>Also note that some browsers may erroneously change POST requests into GET
(thus discarding POST data) when a redirect is issued.</p>
</usage>
</directivesynopsis>
<directivesynopsis>
<name>FallbackResource</name>
<description>Define a default URL for requests that don't map to a file</description>
-<syntax>FallbackResource <var>local-url</var></syntax>
-<default>None - httpd will return 404 (Not Found)</default>
+<syntax>FallbackResource disabled | <var>local-url</var></syntax>
+<default>disabled - httpd will return 404 (Not Found)</default>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context></contextlist>
<override>Indexes</override>
+<compatibility>The <code>disabled</code> argument is available in version 2.4.4 and
+later</compatibility>
<usage>
<p>Use this to set a handler for any URL that doesn't map to anything
in your filesystem, and would otherwise return HTTP 404 (Not Found).
</highlight>
<p>Existing files, such as images, css files, and so on, will be
served normally.</p>
+ <p>Use the <code>disabled</code> argument to disable that feature
+ if inheritance from a parent directory is not desired.</p>
<p>In a sub-URI, such as <em>http://example.com/blog/</em> this
<em>sub-URI</em> has to be supplied as <var>local-url</var>:</p>
<highlight language="config">
-<Directory /web/example.com/htdocs/blog>
+<Directory "/web/example.com/htdocs/blog">
FallbackResource /blog/index.php
+</Directory>
+<Directory "/web/example.com/htdocs/blog/images">
+ FallbackResource disabled
</Directory>
</highlight>
</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>DirectoryCheckHandler</name>
+<description>Toggle how this module responds when another handler is configured</description>
+<syntax>DirectoryCheckHandler On|Off</syntax>
+<default>DirectoryCheckHandler Off</default>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context><context>.htaccess</context></contextlist>
+<override>Indexes</override>
+<compatibility>Available in 2.4.8 and later. Releases prior to 2.4 implicitly
+act as if "DirectoryCheckHandler ON" was specified.</compatibility>
+<usage>
+ <p>The <directive>DirectoryCheckHandler</directive> directive determines
+ whether <module>mod_dir</module> should check for directory indexes or
+ add trailing slashes when some other handler has been configured for
+ the current URL. Handlers can be set by directives such as
+ <directive module="core">SetHandler</directive> or by other modules at
+ runtime. </p>
+
+ <p> In releases prior to 2.4, this module did not take any action if any
+ other handler was configured for a URL. This allows directory indexes to
+ be served even when a <directive>SetHandler</directive> directive is
+ specified for an entire directory, but it can also result in some conflicts
+ with other modules.</p>
+</usage>
+</directivesynopsis>
</modulesynopsis>