I want to remap this: index.php/pages/services
into this index.php/services
.
How I suppose to do that ?
I tried this, but it's not working :
$route['(:any)'] = 'pages/';
== UPDATED ==
Is there any dynamic approach to this method ? So every functions inside that class would become remap without the classname
in url
?
In order to map
www.domain.com/services
topages/services
you would go like:If you want to map
www.domain.com/whatever
topages/whatever
andwhatever
has a few variants and you have a few controllers, then you would do :That is, you need to create rules for all your controllers/actions and the last one should be a catch-all rule, as pointed above.
If you have too many controllers and you want to tackle this particular route, the in your routes.php file it is safe to:
Note, instead of
$_SERVER['PATH_INFO']
you might want to try$_SERVER['ORIG_PATH_INFO']
or whatever component that gives you the full url path.Also, the above is not tested, it's just an example to get you started.