【发布时间】:2020-03-26 14:21:40
【问题描述】:
我尝试在新环境中安装我的 Laravel 应用程序acceptance,
composer install 之后(没有错误)
当我检查网址时,它被重定向到/login,这是正常的
问题:它返回 404 错误,这个错误来自服务器而不是来自 Laravel,因为我在我的应用程序中自定义了 404 错误
似乎服务器只接受/ 路径:
当我更换路由器时:
来自
Route::get('/', function () {
if (Auth::check()) return redirect('/myprofile');
return redirect('/login');
});
对此:
Route::get('/', function () {
return 'hello world'
});
它有效,我可以看到hello world
路由 /login 在我路由时存在:列表
【问题讨论】:
-
好像是重定向问题,请检查是否为apache启用了mod-rewrite模块
标签: laravel apache httpd.conf