如何在没有公用文件夹的根目录中运行 laravel?

2022-01-24 00:00:00 debian php laravel .htaccess apache

我在自己的服务器上运行最新版本的 laravel,运行 Debian 和 Apache2.

I am running the latest version of laravel on my own server running Debian and Apache2.

laravel 的内容位于 /var/www 中,这是我的域名所指向的,但是所有功能都发生了通过 public 目录,所以我必须去 http://mydomain.com/public 访问任何内容.

The contents of laravel are located in /var/www which is what my domain name is pointed to however all of the functionality happens through the public directory so I would have to go to http://mydomain.com/public to access anything.

我想更改它,以便我只需要访问 http://mydomain.com.这可能吗?

I would like to change it so that I only have to access http://mydomain.com. Is this possible?

我该如何改变呢?我是否必须将所有内容上移到 /var 的父级?

How can I change this? Would I have to move everything up another level to the parent at /var?

到目前为止,我还没有在网上找到任何说这是可能的,或者说这是个好主意.

I haven't found anything online so far that says that it is possible, or that it is a good idea.

推荐答案

这不是你的问题,你需要将虚拟主机指向公用文件夹.

That is not your problem, you need to point the virtual host to the public folder.

相关文章