Q:

Using codeigniter routes to leave out a part of the uri

I have this uri http://localhost/ur/index.php/reports/annual/gm/8312/44724286729 but the annual part serves the purpose of showing the user what report he/she is viewing.
The function that is therefore being mapped is gm with the parameters
public function gm($id,$telephone_number{
/**
General Meeting
*/
}

in http://localhost/ur/index.php/reports/annual/gm/8312/44724286729
My controller file is called reports.How would i use routes to ignore annual and only use gm and as my function and other sections of the uri as my parameters namely 8312/44724286729?.
I have tried this in my routes
$route['annual/(:any)'] = "gm";

A:

You could try to use the dollar-sign syntax as such
$route['reports/annual/(:any)/(:any)'] = "reports/gm/$1/$2";

And in your reports controller the gm function will use $1 and $2 as arguments.
P.S.: see the URI Routing section in CI manual.

