强制跳转HTTPS

Apache

网站根目录新建 .htaccess

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

Nginx

if ($server_port = 80) {
rewrite ^(.*)$ https://$host$1 permanent;
}
Last modification:April 4th, 2019 at 10:26 pm
If you think my article is useful to you, please feel free to appreciate

One comment

  1. admin

    测试OωO

Leave a Comment