http强制跳转https教程

WordPress强制跳转https教程

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

 https://imotao.com/302.html

Opencart http强制跳转到https

RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
rewriterule ^(.*)$ https://%{http_host}/$1 [r=301,L]

rewritecond %{http_host} !^www\.* [nc]
rewriterule ^(.*)$ https://www.%{http_host}/$1 [r=301,L]

Opencart默认不强制跳转
RewriteEngine On

RewriteBase /
rewritecond %{http_host} !^www\.* [nc]
rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,L]

posted @ 2022-10-17 16:06  cooler101  阅读(127)  评论(0)    收藏  举报