Could somebody help me with routing rules configuration, please?
I got problem with route optional parameters constraints.
the route named ‘offerRegionCategoryTitle’ should be invoked for /{region}/{category}/{title}/:page: url pattern – and this works properly,
but when I try to invoke
/{region}/{category}/:page: url (etc. /pomorskie/programowanie/1) then the ‘offerRegionCategoryTitle’ route is handled.
I think that the problem is in route rules configuration.
Could somebody help me please?
Source code:
AppRouting: http://jsfiddle.net/kppfP/
The problem is that both routes essentially match the “same” strings. You have 3 dynamic segments (
{region}/{category}/:page:or{region}/{category}/{title}) and there is not enough info for the router to distinguish between both. If:page:is always numeric and{title}isn’t you can add more rules to make sure it doesn’t match the wrong route:See documentation about Route.rules and examples page for more info.