我目前的URI是什麼樣子:localhost/home/saved
,localhost/home/view
笨 - URI路線不工作
我希望它是什麼樣子:localhost/saved
,localhost/view
。
什麼我home
控制器的樣子:
class Home extends CI_Controller
{
public function index() {
//stuff
}
public function saved() {
//stuff
}
public function view() {
//stuff
}
}
我想從網址擺脫home
的,所以用戶可以只需訪問localhost/saved
,在我的家中其他功能,而無需在輸入網址的home
。
我試過把這些放在routes.php
文件中,但沒有運氣。
$route['home/(:any)'] = "$1";
//that didn't work so I tried putting this:
$route['home/(:any)'] = "/$1";
//that didn't work either.
任何幫助,高度讚賞。謝謝!
謝謝,這個修好了! –
@TaylorSwift享受編碼:) –