Keith Devens .com |
Thursday, November 20, 2008 | ![]() |
| This is not The Greatest Song in the World, oh no. This is just a tribute. – Tenacious D | ||
|
| ← Digital IQ quiz | Don't "feel"... THINK → |

Donncha O Caoimh (http://blogs.linux.ie/xeer/) wrote:
Nathaniel (http://www.thornvalley.com) wrote:
Out of curiosity, why would you want to? (and yes, mod_rewrite is probably the answer, though I haven't really used it myself, and wouldn't know what rules to feed it)
Keith (http://keithdevens.com/) wrote:
I figured I could do it with mod_rewrite, but I was hoping there was some other way. I have to learn more about how Apache handles directories... from what I was reading, there is a definite reason why Apache behaves the way it does.
why would you want to?
Just a personal preference... I don't like URLs to end in a slash. Check out all the URLs I use on my site.
Chris (http://today.icantfocus.com/blog/) wrote:
I'm still confused why you want to.
Not using trailing slashes for directory cause 2 trips to the server for all web clients: once for "/directoryfoo", which receives a "Location: /directoryfoo/" redirect response header, then a second request to the server for "/directorfoo/".
I believe this is a standard behaviour even on IIS on windows.
Chris (http://today.icantfocus.com/blog/) wrote:
Shoot. I can't type this evening, but you get the idea.
Keith (http://keithdevens.com/) wrote:
Not using trailing slashes for directory cause 2 trips to the server
Yeah. That's why I'm not going to worry about it. However, if I used mod_rewrite, or, like I do on my site, a CMS that resolves URLs on its own, it wouldn't need the extra redirect.
Chris (http://today.icantfocus.com/blog/) wrote:
Something else to try: MultiViews. I know it does some predefined mod_rewrite magic to make /foo hit /foo.htm, or /foo.htm.en. I've never tried it with directory names, but it may "just work".
Daniel Lorch (http://daniel.lorch.cc/) wrote:
Behaviour is determined by mod_dir:
http://httpd.apache.org/docs/mod/mod_dir.html
An interesting, related Directive is "UseCanonicalName":
RV (http://rv.atomo.info/rv_en.php) wrote:
you can change the status of the directive UseCanonicalName to Off in the httpd.conf file...
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.161s.
(Used 8 db queries)

Probably the best way is to use mod_rewrite as Apache will hand over the url to your mod_rewrite recipe/code where you can do whatever you like to it.