我是新來laravel。在我的項目路線工作不正常。我已經提到很多答案,但沒有任何作用。在我的項目我路線是遵循路線不工作laravel 4.2
Route::get('/',array('uses'=>'[email protected]'));
Route::get('first',array('uses'=>'[email protected]'));
我控制器 ..
class MainController extends BaseController
{
public function index()
{
return View::make('site.index');
}
public function first()
{
return View::make('site.firstpage');
}}
我妥善保管我的視圖文件。 當我給
localhost/gc/public/
它正確加載我的索引頁。但是當我給
localhost/gc/public/first
它不起作用。它拋出一個錯誤
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
當我給出這樣
localhost/gc/public/index.php/first.
它工作正常..。但我需要正確的路由。
有人說我的.htaccess文件可能有問題。 我htaccess文件看起來像這樣
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
,但我需要知道如何解決路由問題。