如何在codeigniter中从url隐藏控制器名称

如何在codeigniter中从url隐藏控制器名称,codeigniter,codeigniter-url,Codeigniter,Codeigniter Url,我有两个管理面板和一个以上的前面板…我有两个不同的控制器,在我的路线。php我做了更改,但由于一些链接不工作 $route['default_controller'] = "site"; $route['404_override'] = ''; $route['contact'] = 'site/contact'; $route['events'] = 'site/events'; $route['terms'] = 'site/terms'; $route['privacy'] = 'sit

我有两个管理面板和一个以上的前面板…我有两个不同的控制器,在我的路线。php我做了更改,但由于一些链接不工作

$route['default_controller'] = "site";
$route['404_override'] = '';
$route['contact'] = 'site/contact';
$route['events'] = 'site/events'; 
$route['terms'] = 'site/terms';
$route['privacy'] = 'site/privacy';
$route['newevent'] = 'site/add_event';

$route['(:any)'] = "site/$1";
//$route['(:any)'] = "backos/$1";
$route['listevents'] = 'backos/events';
$route['listwhatsapp'] = 'backos/whatsapp';
$route['add_artist'] = 'backos/add_artist';
$route['add_club'] = 'backos/add_club';
$route['index'] = 'backos/index';
$route['check'] = 'backos/check';
$route['add_event'] = 'backos/add_event';
$route['add_city'] = 'backos/add_city';
$route['add_locality'] = 'backos/add_locality';
//$route['(:any)'] = "backos/$1";
这是我的routes.php文件。

试试这个

$route['default_controller'] = "site";
$route['404_override'] = '';

$route['contact'] = 'site/contact';
$route['events'] = 'site/events'; 
$route['terms'] = 'site/terms';
$route['privacy'] = 'site/privacy';
$route['newevent'] = 'site/add_event';

$route['listevents'] = 'backos/events';
$route['listwhatsapp'] = 'backos/whatsapp';
$route['add_artist'] = 'backos/add_artist';
$route['add_club'] = 'backos/add_club';
$route['index'] = 'backos/index';
$route['check'] = 'backos/check';
$route['add_event'] = 'backos/add_event';
$route['add_city'] = 'backos/add_city';
$route['add_locality'] = 'backos/add_locality';

// this is a catch all if you don't put it as 
// the last one everything else below it wont work!
$route['(:any)'] = "site/$1";