任何人帮助我停止在超文本传输协议重定向到WordPress网站的https。
以下是场景
http://example.com 301永久移动了https://example.com/ 301永久移动了https://www.example.com/ 200 OK
发布于 2018-03-22 04:34:56
所以如果我没理解错的话,这是你的.htaccess文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>你想把页面从http://example.com和https://example.com重定向到https://www.example.com,这样做正确吗?
如果是这样,请使用以下命令:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] 这样做的目的是,它将页面从非www重定向到www,然后强制https。
https://stackoverflow.com/questions/49398317
复制相似问题