CodeIgniter Forums
Override :any routes - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: Override :any routes (/thread-32819.html)

Override :any routes - El Forum - 08-05-2010

I have a route setup for '/page/:any'

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

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

Override :any routes - El Forum - 08-05-2010

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').

Override :any routes - El Forum - 08-05-2010

Ahh I had it reversed.. thank you! Smile