Php Codeignitor-登录前的路由为默认路由,登录后的路由为动态路由

Php Codeignitor-登录前的路由为默认路由,登录后的路由为动态路由,php,.htaccess,routes,codeigniter-2,Php,.htaccess,Routes,Codeigniter 2,我有一个URL,我需要在登录前获取数据库名,所以 $route['(:any)]=$route['default_controller'] 上面提到的总是登录控制器,但登录后我的路径是 $route['(:any)/(:any)']='$1/$2'; $route['(:any)(.*)']='$1'; also tried $route['(:any)']='$1'; $route['(:any)'] = $route['default_controller']; But only one

我有一个URL,我需要在登录前获取数据库名,所以

$route['(:any)]=$route['default_controller']
上面提到的总是登录控制器,但登录后我的路径是

$route['(:any)/(:any)']='$1/$2';
$route['(:any)(.*)']='$1'; also tried $route['(:any)']='$1';
$route['(:any)'] = $route['default_controller'];

But only one works either $route['(:any)']='$1' or $route['(:any)'] = $route['default_controller'];
If before login then I need $route['(:any)'] = $route['default_controller']; this to work