How to run laravel in root directory without the public folder?(如何在没有公用文件夹的根目录中运行 laravel?)
问题描述
我在自己的服务器上运行最新版本的 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.
这篇关于如何在没有公用文件夹的根目录中运行 laravel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在没有公用文件夹的根目录中运行 laravel?


基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01