How to hide controller name in the url in CodeIgniter?

You can define a custom route in config/routes.php - for example:

$route['about'] = 'name_controller/about';

Then, http://example.com/about
goes to http://example.com/name_controller/about

See Hiding the controller’s method name in the URL? in the CI forums for more information.


You can add an entry in the /system/application/config/routes.php file:

$route['about'] = "controller_name/about";

I did it like this: (config/routes.php)

Code: $route['((photos|blogs).+)'] = "$1";

$route['([a-zA-Z0-9_-]+)'] = "user/profile/$1";

it is ok correct solutions for common.