[英].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.