Apache强制http跳转至https的伪静态规则

      发布在:后端技术      评论:0 条评论
Apache强制http跳转至https的伪静态规则,原来网络上流传有指定域名实现的方式,下面实现的方式是非443端口将直接跳转至https,Apache伪静态规则实现方式如下:
<IfModule mod_rewrite.c>
RewriteEngine on
  RewriteBase /
  RewriteCond %{SERVER_PORT} !^443$
  RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</IfModule>


热门推荐