Re: Bug#391290: apache should automatically detect extra periods/commas at the end of URLs and fix
2006/10/7, Stefan Fritsch <email@example.com> wrote:
On Friday 06 October 2006 00:32, Jason Spiro wrote:
> > This can be done with mod_speling or with something like
> > RewriteRule ^(.*)[,.]$ $1 [R]
> > though the latter will prevent you from requesting any file
> > ending with period or comma. With some more refined rewrite magic
> > using subrequests, you can probably avoid that.
> > However, by default Apache should return exactly what was
> > requested. Therefore I close this bug.
> Why shouldn't Apache ship with a RewriteRule to correct such a
> common error by default? It's very uncommon for webmasters to post
> files whose names end with a period or comma anyway.
- if you don't know that the rule is active, it would lead to quite
unexpected and hard to debug behaviour (who knows what kind of URLs
are used by some webapp...)
- you don't want to have mod_rewrite active by default (there have
been security issues that only affect mod_rewrite)
- mod_speling does quite a bit more, so you don't want to have that
active by default either
As Roberto mentions, it would be useful for Apache admins if there
were a default rewrite.conf in mods-available/ with such a rewrite
rule, and a comment:
# This rule automatically removes all trailing periods and commas from
requested URLs. This is useful in cases where someone tells someone
else about a website in the middle of a sentence and then puts a
period or comma right after the URL. Some inexperienced users think
the period or comma is part of the URL and type it into their web
Jason Spiro: computer consulting with a smile.
I also provide training and spyware removal services for homes and businesses.
Call or email for a FREE 5-minute consultation. Satisfaction guaranteed.
416-781-5938 / Email: firstname.lastname@example.org / MSN: email@example.com