繁体   English   中英

.htaccess http到https重定向太多次

[英].htaccess http to https redirecting too many times

我的域名是www.supergenscript.com。 它托管在www.easycloud.us上,所有DNS已使用CloudFlare配置。 我的.htaccess文件中包含以下代码。

RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

我的.htaccess文件中没有其他内容。 这是我的.htaccess现在拥有的完整代码。 我使用此代码的目的是自动从http重定向到https。 从http更改为https,但未加载索引页面。 取而代之的是,浏览器继续加载,最后在花了很多时间后给出了错误。

这是我的Google Chrome浏览器收到的错误

This page isn’t working

www.supergenscript.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

请帮助我找到解决此问题的方法。 我真的很沮丧。

尝试这个:

RewriteCond %{HTTP:X-Forwarded-Proto} !http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

上述解决方案对我不起作用

检查这个

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

或者这个

RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ https://www.supergenscript.com%{REQUEST_URI} [NC,L]

暂无
暂无

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

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