我安裝了laravel並獲得主頁localhost/laravel/public
。 但無法做簡單的路由。Laravel無法加載除家庭以外的其他網址(/)?
Route::get('/', function()
{
return View::make('hello');
});
Route::get('authors',function()
{
return View::make('hello');
});
這裏我打電話給localhost/laravel/public/authors
上的同一個視圖。 但我得到404
我有也/
但與authors
Route::get('/', function()
{
return View::make('authors');
});
Route::get('authors',function()
{
return View::make('authors');
});
現在我得到作者的/
但與authors
查看不同的看法。
感謝
是Apache安裝? ...啓用了mod_rewrite指令? – naththedeveloper
看看'localhost/laravel/public/index.php/authors'是否有效。 – user1669496
它的工作原理'本地主機/ laravel /公/ index.php文件/ authors'加入兩行'RewriteEngine敘述上 RewriteBase後 – Gangaraju