【发布时间】:2017-10-27 20:53:57
【问题描述】:
我在共享主机上托管我的 Laravel 项目,我无权修改 apache 配置以在 /public 中查找 index 文件。
我还尝试将DirectoryIndex index.html 添加到我的.htaccess 文件中,在主机正在寻找index.php 文件的地方。
这不起作用。
话虽如此,我想我可以解决这个问题,只要我将index.php 文件从/public(Laravel 默认拥有它)移到主机正在寻找它的root。
话虽如此,我需要在这个 index.php 文件中修改什么以允许 Laravel 应用程序工作?
我的结构是:
public_html/ <-- where my files are served from and where index.php should be
my-project/
public/
index.php <-- where Laravel expects index.php to be to bootstrap the app
【问题讨论】:
-
如果您要托管它,那么只需将您的域指向 Laravel 公共文件夹,为什么需要将
index.php移到公共文件夹之外?
标签: php apache laravel .htaccess laravel-5.1