【问题标题】:VirtualHost causes a redirect loopVirtualHost 导致重定向循环
【发布时间】:2014-01-29 19:30:46
【问题描述】:

我为我的子域创建了一个 VirtualHosts,但它一直在进行重定向循环。

例如:我输入 beta.domain.com 并重定向到 beta.domain.com/index.php/index.php/index.php/... 并给我服务器有一个重定向循环错误消息。

配置:

<VirtualHost IP>
ServerName www.beta.domain.com
ServerAlias domain.com
DirectoryIndex index.php
DocumentRoot /var/www/html/beta/
</VirtualHost>

有人可以帮忙吗?非常感谢:)

【问题讨论】:

  • 您在上面发布的配置信息中没有问题;这是某处的RewriteRule 指令的问题。请发布其余的配置文件和您正在使用的任何.htaccess 文件。
  • @EdCottrell 我没有 .htaccess
  • 好的,这就是我说“任何”的原因。但是,您确实需要发布配置文件的其余部分。您发布的内容不可能导致错误。
  • @EdCottrell 这就是该域的所有配置文件
  • 要么有更多的配置文件,要么你的 PHP 文件导致了重定向。无论哪种方式,您在上面发布的内容都不足以帮助您。

标签: apache virtualhost


【解决方案1】:

VirtualHost allone 永远不会进行重定向,请查看 DocumentRoot 上的一些 .htaccess 重写 如果您找不到 .htaccess 文件,请将其添加到您的 VirtualHost 配置中禁用它 .htaccess

 <Directory /path/to_documentroot>
 AllowOverride None
 </Directory>

对不起英语不好

【讨论】:

    猜你喜欢
    • 2014-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-05
    • 1970-01-01
    相关资源
    最近更新 更多