To achieve this, you can use the URI routing code link -
Insert this at the end of the route file -
$route[':any'] = 'path of the default controller';
All other routes should be placed above the upper code.
Let's say the URL you encounter is
http://fancysite.com/category
So first, codeigniter will look for whether there is a controller named category. if he does not receive this, then he will check the route file to verify that there is any route indicated as follows:
$route['category/:any'] = 'actual path';
If no such route is specified, then codeigniter sends this; request the path to the default controller specified in the last line of routes.
, ,
.
-
.
'category' URL, ,
URL codeigniters URI , -
$this->uri->segment(1);