$route['(:any)'] = 'pages/view/$1'; means that everything that you type on url will go to pages/view/$1 $1 here - this is the parameter that you want to pass to the controller / method example
$route['login/(:any)'] = 'home/bacon/$1';
in this example, you tell CI that everything that is sent to login with any parameter, for example login/john , will go to your home/bacon/john (:any) , will match all strings and integers if you use (:num) , it will only match integer parameters, for example
$route['login/(':num')'] = 'home/bacon/$1'
in this configuration, you indicate that if url login has an integer after it, like login/1234 , you want it to be redirected to home/bacon/1234 , if you donβt know how many parameters you would like to go through, you can try $route['login/(:any).*'] = 'home/bacon/$1' you can read more about this at https://www.codeigniter.com/user_guide/general/routing.html
source share