#636 wiki: Rewrite rule to fix trailing slash
Closed: Fixed None Opened 13 years ago by ivazquez.

There's just a bit of chaos being caused due to the fact that MW considers page names that end with "/" to be valid targets. The following rule prevents people from going onto a page that ends with a "/", but not prevent people from getting to current pages via "/#" so they can fix them.

This mod_rewrite rule will fix it:

{{{
RewriteRule ^(.*)/$ $1 [R=301]
}}}

Alternately, this mod_alias rule '''may''' fix it:

{{{
RedirectMatch permanent (.*)/ $1
}}}


I suppose it might be useful to have this rewritten to Special:Prefixindex so that you get a kind of "directory listing," but that's probably overkill. I think the rewrite is a good idea in any case.

Login to comment on this ticket.

Metadata