Welcome Guest, Not a member yet? Register   Sign In
Override :any routes
#1

[eluser]GeXus[/eluser]
I have a route setup for '/page/:any'

I'd like to override it, only if the proceeding value is 'lp', so for example
'/page/lp/:any'

This doesn't seem to work though... Any ideas if there's a better way to override it for certain cases?
#2

[eluser]Jelmer[/eluser]
Routing rules are processed in the order in which you put them. It's not "best fit" it's "first match". So if your :any rule already matched the page/lp, that second "override" rule will never be processed.
Always put the more specific rule (‘/page/lp/:any') before the more general rule (‘/page/:any').
#3

[eluser]GeXus[/eluser]
Ahh I had it reversed.. thank you! Smile




Theme © iAndrew 2016 - Forum software by © MyBB