You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2004/07/04 12:19:49 UTC
cvs commit: httpd-2.0/docs/manual/mod mod_dir.xml
nd 2004/07/04 03:19:49
Modified: docs/manual/mod mod_dir.xml
Log:
document the brand new DirectorySlash directive
Revision Changes Path
1.10 +54 -1 httpd-2.0/docs/manual/mod/mod_dir.xml
Index: mod_dir.xml
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_dir.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- mod_dir.xml 17 Apr 2004 10:49:22 -0000 1.9
+++ mod_dir.xml 4 Jul 2004 10:19:48 -0000 1.10
@@ -96,4 +96,57 @@
</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>DirectorySlash</name>
+<description>Toggle trailing slash redirects on or off</description>
+<syntax>DirectorySlash On|Off</syntax>
+<default>DirectorySlash On</default>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context><context>.htaccess</context></contextlist>
+<override>Indexes</override>
+<compatibility>Available in version 2.1 and later</compatibility>
+
+<usage>
+ <p>The <directive>DirectorySlash</directive> directive determines, whether
+ <module>mod_dir</module> should fixup URLs pointing to a directory or
+ not.</p>
+
+ <p>Typically if a user requests a resource without a trailing slash, which
+ points to a directory, <module>mod_dir</module> redirects him to the same
+ ressource, but <em>with</em> trailing slash for some good reasons:</p>
+
+ <ul>
+ <li>The user is finally requesting the canonical URL of the resource</li>
+ <li><module>mod_autoindex</module> works correctly. Since it doesn't emit
+ the path in the link, it would point to the wrong path.</li>
+ <li><directive module="mod_dir">DirectoryIndex</directive> will be evaluated
+ <em>only</em> for directories requested with trailing slash.</li>
+ </ul>
+
+ <p>Well, if you don't want this effect <em>and</em> the reasons above don't
+ apply to you, you can turn off the redirect with:</p>
+
+ <example>
+ # see security warning below!<br />
+ <Location /some/path><br />
+ <indent>
+ DirectorySlash Off<br />
+ SetHandler some-handler<br />
+ </indent>
+ </Location>
+ </example>
+
+ <note type="warning"><title>Security Warning</title>
+ <p>Turning off the trailing slash redirect may result in an information
+ disclosure. Consider a situation where <module>mod_autoindex</module> is
+ active (<code>Options +Indexes</code>) and <directive module="mod_dir"
+ >DirectoryIndex</directive> is set to a valid resource (say,
+ <code>index.html</code>) and there's no other special handler defined for
+ that URL. In this case a request with a trailing slash would show the
+ <code>index.html</code> file. <strong>But a request without trailing slash
+ would list the directory contents</strong>.</p>
+ </note>
+</usage>
+</directivesynopsis>
+
</modulesynopsis>
Re: cvs commit: httpd-2.0/docs/manual/mod mod_dir.xml
Posted by André Malo <nd...@perlig.de>.
* Joshua Slive <jo...@slive.ca> wrote:
> I think you forgot the most important reason:
>
> <li>Relative URL references inside html pages will work correctly.</li>
Good point. Thanks :)
nd
--
Da fällt mir ein, wieso gibt es eigentlich in Unicode kein
"i" mit einem Herzchen als Tüpfelchen? Das wär sooo süüss!
-- Björn Höhrmann in darw
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org
Re: cvs commit: httpd-2.0/docs/manual/mod mod_dir.xml
Posted by Joshua Slive <jo...@slive.ca>.
On Sun, 4 Jul 2004 nd@apache.org wrote:
> + <ul>
> + <li>The user is finally requesting the canonical URL of the resource</li>
> + <li><module>mod_autoindex</module> works correctly. Since it doesn't emit
> + the path in the link, it would point to the wrong path.</li>
> + <li><directive module="mod_dir">DirectoryIndex</directive> will be evaluated
> + <em>only</em> for directories requested with trailing slash.</li>
> + </ul>
I think you forgot the most important reason:
<li>Relative URL references inside html pages will work correctly.</li>
Joshua.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org