我使用Composer安装了Laravel 4并设置了虚拟主机.目前,只有根路由正在工作:
<?php
Route::get('/', function()
{
return View::make('hello');
});
Run Code Online (Sandbox Code Playgroud)
这不是:
Route::get('/hello', function()
{
return View::make('hello');
});
Run Code Online (Sandbox Code Playgroud)
我试图打是TasksController在/tasks:
Route::resource('tasks', 'TasksController');
Run Code Online (Sandbox Code Playgroud)
这也给了我404错误.我能做错什么?我在项目的根目录下有一个默认的.htaccess文件:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
我在Mac上使用localhost.
routing http-status-code-404 laravel laravel-4 laravel-routing
无论如何使用PHP来检查值AllowOverride是否.htaccess会产生任何影响?