简体   繁体   English

Symfony中的子域给出内部服务器错误

[英]Subdomain in Symfony gives Internal Server Error

I have a Symfony project (example.com) and added a subdomain (demo.example.com) pointing to the same app. 我有一个Symfony项目(example.com),并添加了指向同一应用程序的子域(demo.example.com)。 The subdomain gives an Internal Server Error. 子域给出内部服务器错误。 The error log shows: AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. 错误日志显示:AH00124:由于可能的配置错误,请求超出了10个内部重定向的限制。 Use 'LimitInternalRecursion' to increase the limit if necessary. 必要时使用'LimitInternalRecursion'增加限制。

I set op my routing.yml like this: 我像这样设置op我的routing.yml:

account_homepage:
    path:     /
    host:     "{subdomain}.{domain}"
    defaults:
        _controller: AppBundle:Default:loginRedirect
    requirements:
        subdomain: demo|myaccount

homepage:
    path:     /
    defaults:
        _controller: AppBundle:Default:loginRedirect

Based on the Symfony docs in How to Match a Route Based on the Host . 基于Symfony文档, 如何基于主机匹配路由 Similar questions seem to point to the .htaccess file but I used the htaccess file shipped with Symfony: 类似的问题似乎指向.htaccess文件,但我使用了Symfony随附的htaccess文件:

<IfModule mod_authz_core.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
</IfModule>

What is the way to go to get subdomains working in my project? 使子域在我的项目中工作的方式是什么?

在DirectAdmin中将子域更改为“域指针”,使subdomain.example.com成为example.com的别名是我的项目的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM