【发布时间】:2020-10-03 07:12:19
【问题描述】:
我使用 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。
【问题讨论】:
-
Amit:你的问题解决了吗?如果是,请发布您的解决方案,因为我的 laravel 项目面临同样的问题。提前致谢
-
@AmitErandole 哎呀。我们似乎错过了您发布的 gist.github.com/4131966 的要点。
标签: laravel laravel-4 routing http-status-code-404 laravel-routing