Laravel快速入门指南路线返回404

时间:2014-10-13 11:57:40

标签: laravel-4 routes http-status-code-404

所以我是一个新的Laravel用户,我只是直接进入文档开始。但我得到一个问题: 在app / routes.php中,我这样写:

Route::get('users',function() {
return 'hello';
});
Route::get('/',function() {
return View::make('hello');
});

当我点击

127.0.0.1/aerial/public/

它工作正常;点击时:

127.0.0.1/aerial/public/index.php/users or 127.0.0.1/aerial/public/users or localhost/aerial/public/index.php/users

它返回404;我的环境nginx。

1 个答案:

答案 0 :(得分:0)

您应该将.htaccess目录中的public文件转换为nginx格式,并确保已启用mod重写(或用于此的nginx模块)