我使用 Composer 安装了 Laravel 4 并设置了一个虚拟主机。目前,只有根路由有效:
<?php
Route::get('/', function()
{
return View::make('hello');
});
这不是:
Route::get('/hello', function()
{
return View::make('hello');
});
我要打的TasksController
是/tasks
:
Route::resource('tasks', 'TasksController');
这也给了我 404 错误。我可能做错了什么?我在项目的根目录中有一个默认的 .htaccess 文件:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我在 Mac 上使用 localhost。