2
In the archive Routes.php I defined the following route:
$route['(:any)'] = 'reference/check/$1';
I need it because the first parameter in the URL after the domain is the username (exemplo.com/{nome_usuario}
). Then I perform checks on the Reference class.
The problem is that in this case all the others Controllers were inaccessible, all being overwritten by the route rule as shown above.
As a temporary solution I had to force others Controllers defining Routes for them as well, being as follows:
$route['home'] = 'home';
$route['login'] = 'login';
$route['register'] = 'register';
$route['(:any)'] = 'reference/check/$1';
Is there any alternative I can use so I don’t need to set new ones Routes whenever I create a new Controller?