On Jan 28, 2009, at 6:44 AM, Pavel Skvazh wrote:

Is there a way (if not, is it worth adding) to tell routes to match
routes with both trailing slash and without.
Say to match /articles/ and /articles
I have to right two identical routes just to match them both.

I think i heard someone saying that supporting both is a bad practice.
Just want some feedback from groups experience.

First, thats not good from a relative URL standpoint, since constructing a relative URL on a page that matches both of those URL's will lead to two different spots (one of them prolly invalid). If you really want both to work, you should redirect from one to the one that should be *the* page, ie:
map.redirect('/articles/', '/articles')

Or if you always want to redirect something ending in a slash to the non-slash version:
map.redirect('/{controller}/, '/{controller}')

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to