softboxkid softboxkid - 5 months ago 18
PHP Question

Codeigniter - Hide controller name. Just show parameter

I need to hide my controller name from being shows in the URL. Currently this is the URL

my route file is like this:

$route['page/(:any)'] = "frontend/$1";
$route['login'] = "frontend/login";

I want to remove the "page" in the URL. So it should be like this:

How to do this. Please help me. Is it possible to do that?


Use this, as the last route defined in the routes.php file. It's important to define this wildcard route as the last route.

$route['(:any)'] = "frontend/$1";