Can you also please take a look at the bug I've sent you regarding routes?
On Jan 28, 9:16 pm, Ben Bangert <[email protected]> wrote: > 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 > > smime.p7s > 3KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
