Symfony:为什么我的主页example.com/web而不是example.com(应该是?) [英] Symfony: why is my main page example.com/web instead of example.com (as it should be?)

查看:154
本文介绍了Symfony:为什么我的主页example.com/web而不是example.com(应该是?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目录树看起来像这样:

My directory tree looks something like this:

public_html
  example.com(containing symfony files)
    lib
    web
    app 
    etc...
  example.net
  example1.com
  example1.net

当我通过example.com访问我的网站时,它只会在文件夹example.com下显示我的目录树,而不是路由到我的实际主页。如何解决这个问题?

When I access my site via example.com it just shows my directory tree under the folder example.com, instead of routing to my actual homepage. How do I fix this?

推荐答案

您应该放置所有文件( web除外目录)直接位于 web 目录之上的目录中。
然后在 web 目录中创建符号链接 public_html ,或将文件添加到 public_html ,然后在您的 ProjectConfiguration 调用 $ this-> setWebDir(realpath('../ public_html '));

You should place all files (except the web directory) in the directory directly above the web directory. Then create a symlink public_html to your web directory, or add the files to your public_html, and then in your ProjectConfiguration call $this->setWebDir(realpath('../public_html'));

这篇关于Symfony:为什么我的主页example.com/web而不是example.com(应该是?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆