Apache 配置 http 转 https

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{SERVER_PORT} !^443$
  RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]
  
  RewriteEngine On
  RewriteCond %{HTTP_HOST} www.wqj17.cn [NC]
  RewriteRule ^(.*)$ http://wqj17.cn/$1 [L,R=301]
</IfModule>

猜你喜欢

转载自www.cnblogs.com/whm-blog/p/9116815.html