📌  相关文章
📜  htaccess 重定向到 https - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:15.537000             🧑  作者: Mango

代码示例6
# Redirect to HTTP non-www to HTTPS www htaccess

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]