【问题标题】:Too many redirects - htaccess重定向太多 - htaccess
【发布时间】:2017-01-08 23:06:27
【问题描述】:

我正在尝试使用 htaccess 设置从 www 到非 www 以及从 http 到 https 的重定向,但我收到“重定向过多”错误。我的 htaccess 是:

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

还有一些标头(XSS、CSP...)

【问题讨论】:

    标签: .htaccess redirect mod-rewrite


    【解决方案1】:

    这是因为我的虚拟主机使用了反向代理。

    【讨论】:

      猜你喜欢
      • 2019-09-11
      • 1970-01-01
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-15
      相关资源
      最近更新 更多