我使用CodeIgniter的routes
文件将短网址重新映射到相关的控制器功能。
奇怪的是,一些网址被重新映射,而其他网址则没有,即使语法相同。
以下是我的routes.php
文件。 info/web
和info/rent
的重新映射按预期工作,而info/cell
和info/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";