0
我的WordPress網站是在WordPress管理https://www.example.com
下Settings/general
的WordPress從http反彈至HTTPS和回HTTP,然後終於到https
我使用Simple SSL
插件。這是我的.htaccess
。
<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteCond %{HTTP_HOST} =example.com
#RewriteRule (.*) https://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example.com[nc]
RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} wp-admin
RewriteRule ^(.*)$ https://www.example.com/wp-admin/ [R,L]
</IfModule>
# BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.22]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
出於某種原因,當去到example.com
它從基於HTTP> https->基於HTTP> HTTPS
example.com
https://example.com
http://www.example.com
https://www.example.com
替換RewriteCond行,如果我這樣做,它永遠不會導航到「https:// www.example.com」。它停留在'https:\\ example.com'。它實際上這樣做,即使我從htaccess中刪除所有內容 – codeNinja
你使用哪一個,有'X-Forwarded-Proto'或'SERVER_PORT'?你也試過另一個嗎? – janh
我試過'x-forwarded-proto'。我也嘗試了其他。都導致反彈 – codeNinja