【发布时间】:2017-10-26 14:20:30
【问题描述】:
目前我正在使用http://example.com,但我想将所有内容重定向到 https://www.example.com
我在这里阅读了几个主题并尝试了很多解决方案,但对我没有任何效果。
我最后一次尝试是这样的:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
当我使用此代码时,我可以看到: enter image description here
但它也给了我这个信息:
页面未正确重定向。 Firefox 检测到 服务器正在以某种方式重定向对该地址的请求 永远不会完成。
你能帮我解决这个问题吗?
【问题讨论】:
标签: .htaccess http redirect web https