Q:

Codeigniter - Twitter like URI Routing

Say I wanted the following URL scheme, which I got to work by setting the following URI route.
http://www.domain.com/profile/jimbob123
$route['profile'] = "profile/index";
$route['profile/(:any)'] = "profile/index/$1";

Now, let's say I want my URL to look like the following when I want to display a "status."
http://www.domain.com/profile/jimbob123/status/908734efc
How do I go about passing "jimbob123" and "908734efc" into my method so I can check and retrieve this particular record? I tried the following but it doesn't seem to work.
$route['user/(:any)/status/(:any)'] = "user/plan/$1/$2";

A:

I assume where you wrote user/(:any)/status/(:any) you meant profile/(:any)/status/(:any)
That might be one problem, also this:
The routes are matched in the order they are declared. If you wrote it like this:
$route['profile'] = "profile/index";
$route['profile/(:any)'] = "profile/index/$1";
$route['profile/(:any)/status/(:any)'] = "user/plan/$1/$2";

It wont work because "http://www.domain.com/profile/jimbob123/status/908734efc" matches the second route.
If you swap the second and third line you should be good.
$route['profile'] = "profile/index";
$route['profile/(:any)/status/(:any)'] = "user/plan/$1/$2";
$route['profile/(:any)'] = "profile/index/$1";

