Welcome Guest, Not a member yet? Register   Sign In
SOLVED: Ordering of the routers?
#1

[eluser]jof[/eluser]
Hi

I have one question regarding the routing and ordering in the routers.php config file.

If I have an url like: http://domain.com/member/tom/archive

And two routing like this

Quote:$route['member/(:any)'] = "member/index/$1";
$route['member/(:any)/archive'] = "member/archive/$1";

The first router will grab my url and send it to "member/index/$1"
I want it to be sent to the second router "member/archive/$1" ??

Now I change the order of the routers thing suddenly work different?

Quote:$route['member/(:any)/archive'] = "member/archive/$1";
$route['member/(:any)'] = "member/index/$1";

Does CI routers allways send the request to the FIST possible match, even if there is a "better" later in the routers.php file?

Or am I totally doing things wrong here?

regards / Johannes




Theme © iAndrew 2016 - Forum software by © MyBB