Laravel项目传输到另一台服务器显示404错误
在旧服务器中,该项目运行良好。我已将其放入其备份文件夹中。数据库已转移到新服务器。现在我转移了整个项目文件夹。为了更好地理解,我们假设旧项目 URL 为 www.oldproject.com 。现在我像这样转移它: www.newdomain.com/newproject 我将整个 laravel 项目放在 newproject 文件夹中。现在它显示 404 错误。
我是 Laravel 的新手。我的 laravel 版本是 7.30.1,我的服务器 PHP 版本是 7.4.26
我是 laravel 新手,我不知道如何解决这个问题。我
Route::group(['domain' => 'newdomain.com/newproject'], function()
在 newdomain.com/newproject/routes/web.php 中
进行了更改,请指导我如何运行该项目。任何帮助将不胜感激。谢谢。
In the old server, the project is working fine. I had given it to its backup folder. The database is already transferred to a new server. Now I transferred the whole project folder. For better understanding, Let's assume that the old project URL is www.oldproject.com. Now I transferred it like this : www.newdomain.com/newproject I put the whole laravel project in newproject folder. Now its displayed 404 error.
I am new to laravel. My laravel version is 7.30.1 and my server PHP version is 7.4.26
I am new to laravel and I don't know how to solve this. I changed
Route::group(['domain' => 'newdomain.com/newproject'], function()
in newdomain.com/newproject/routes/web.php
Please guide me how to make run this project. Any help will be appreciated. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可惜花了这么长时间才得到答案。但我想说的是,在你的 apache2 可用站点中,创建并启用一个包含别名的站点,例如
Alias /newproject "/var/www/html/newproject/public"
shame it took this long for an answer. but I would have said in your apache2 sites-available, create and enable one with alias included, like
Alias /newproject "/var/www/html/newproject/public"