Routes with wildcard (: any) ignoring other controllers

2
In the routes.php file I set 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 check the Reference class.

The problem is that in this case all other Controllers were inaccessible, all of which were overridden by the route rule as I showed above.

As a workaround I had to force the other Controllers by setting routes for them as well,

$route['home'] = 'home';
$route['login'] = 'login';
$route['register'] = 'register';
$route['(:any)'] = 'reference/check/$1';

Is there any alternative that I can use so that I do not have to define new routes whenever I create a new Controller ?     

asked by anonymous 26.06.2015 / 06:18

1 answer

0

So far, there is no alternative. Since the (:any) tag serves just to accept anything, you'll need to tell which routes you want to keep as a driver rather than redirect.

    
27.04.2016 / 07:04