softboxkid softboxkid - 1 year ago 90
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?

Answer Source

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";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download