• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URI Routing not working properly

I am using the following routing rules

$route['(:any)-(:num)'] = "category/$2";
$route['(:any)-(:num)/(:any)-(:num)'] = "listing/$4";

While the first one works just fine, the second rule does not.

For example,

works, while


does not. It just leads me to a not found error, when in fact the rerouting url would be valid if it was routing correctly.

Can anyone pinpoint the problem?

[eluser]Rok Biderman[/eluser]
You should change the order of the routes, so that the more specific is the first. This way you're always executing the first one, 'cause everything that would satisfy the second condition also satisfies the first.

I didn't think it would be that simple Tongue Thanks a lot, it worked Big Grin

thanks, great tip

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.