我是新来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]
,但我需要知道如何解决路由问题。