CodeIgniter routes.php行为不一致

时间:2015-05-11 15:54:40

标签: codeigniter routes

我使用CodeIgniter的routes文件将短网址重新映射到相关的控制器功能。

奇怪的是,一些网址被重新映射,而其他网址则没有,即使语法相同。

以下是我的routes.php文件。 info/webinfo/rent的重新映射按预期工作,而info/cellinfo/hotel会重定向到我的404函数。

知道可能导致它的原因吗?

$route['default_controller'] = "home";
$route['404_override'] = 'home/four_o_four';
$route['robots.txt'] = 'home/robots';

$route['info/cell'] = "articles/tags/cellphone";
$route['info/rent'] = "articles/tags/car-rental";
$route['info/web'] = "articles/tags/internet-abroad";
$route['info/hotel'] = "articles/tags/hotel";
$route['articles/tags/(:any)'] = "articles/articles_by_tags/$1";
$route['articles/destination/(:any)'] = "articles/articles_by_destination/$1";
$route['articles/(:any)'] = "articles/show_article/$1";

0 个答案:

没有答案