You can do this using $route .
If you have only one Controller , and on this controller you all functions can write something like this:
$route['(:any)'] = "Controller_Name/$1";
If you have many Controllers , you need to specify for each function what the controller indicates. Like this:
$route['function1'] = "Controller_Name1/function1"; $route['function2'] = "Controller_Name1/function2"; $route['function3'] = "Controller_Name3/function3";
And you cannot have duplicates in $route
This array $route must be located here: application/config/routes.php .
Here you can find out more about the routes in the CI documentation: https://www.codeigniter.com/userguide3/general/routing.html
source share