强制跳转HTTPS 发布于 2018年4月5日 · 更新于 2019年4月4日 · 阅读时间约 1 分钟 · 分类: 技术 目录 Apache Nginx Apache 网站根目录新建 .htaccess text复制RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L] Nginx text复制if ($server_port = 80) { rewrite ^(.*)$ https://$host$1 permanent; }
评论