如何在Codeigniter中进行路由?

时间:2015-11-17 19:27:05

标签: codeigniter routing codeigniter-2

现在我有一些在文件CI routes.php中路由的规则:

$route['^fr/(.+)$'] = "$1";
$route['^en/(.+)$'] = "$1";

当我使用URL作为:

时,它可以正常工作
http://test.com/en/news

但不起作用:

http://test.com/en/news/3

 http://test.com/en/news/4/1/3/any

有新闻路由后:

// NEWS

$route['news/search'] = "news/search";
$route['news/(:num)'] = "news/getNew/$1";
$route['news/category/(:num)/(:any)'] = "news/filter/$1";
$route['news/category/(:num)'] = "news/filter/$1";

0 个答案:

没有答案