在codeigniter中管理htaccess文件中的路由

时间:2012-12-06 08:37:50

标签: php .htaccess codeigniter routes

我在路线文件中有这个内容:

$route['logout']                = 'admin/logout';
$route['res_yass']              = 'page/index/res_yass';
$route['res_nesr']              = 'page/index/res_nesr';
$route['societe']               = 'page/index/societe';
$route['app_type']              = 'page/index/app_type';
$route['future_plan_situation'] = 'page/index/future_plan_situation';
$route['plan_situation']        = 'page/index/plan_situation';
$route['fini_stand']            = 'page/index/fini_stand';
$route['future_app_type']       = 'page/index/future_app_type';

现在工作正常,但每当我想要添加页面时,我必须在路线页面中添加它,这不是一个好主意。那么如何在htaccess文件中更改它,除了注销一个。 提前完成。

1 个答案:

答案 0 :(得分:2)

试试这个

$route['(:any)'] = "page/index/$1";
$route['logout'] = 'admin/logout';