2011-01-28 74 views
2

有沒有一種方法來捕獲所有URL請求,並將它們路由?有點像:在CodeIgniter中路由所有URL請求?

$route['everything'] = "controller"; 
+0

你想如何路由?你想把`everything`作爲一種方法的方法或參數嗎? – 2011-01-28 13:23:10

回答

4
$route['(:any)'] = "controller"; 
+0

我試過了,沒有工作。事實證明,我的控制器搞砸後,修復它的一些工作。謝謝您的幫助。 – 2011-01-28 13:01:35

1

試試這個 -

$route[':any'] = 'path of the default controller'; 

你能得到它的文檔here

2
$route['(:any)'] = "your_controller/your_method/$1"; 

這應該工作。這樣,(:any)中的內容將作爲參數傳遞給您的方法。