openlitespeed.png

1、http 301 to https .htaccess规则【@ to www视具体情况增减】

1.1、虚拟主机—重写—重写规则

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ https://www.%{SERVER_NAME}/$1 [L,R=301]

1.2、http to https

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]

2、启用HSTS

虚拟主机—资源集—static—头部操作

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options nosniff
X-XSS-Protection 1;mode=block
X-Frame-Options SAMEORIGIN