复制代码
- RewriteEngine On
- RewriteCond %{SERVER_PORT} 80
- RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
RewriteEngine on
复制代码
- # 强制HTTPS
- RewriteCond %{HTTPS} !=on [OR]
- RewriteCond %{SERVER_PORT} 80
- # 某些页面强制
- RewriteCond %{REQUEST_URI} ^something_secure [OR]
- RewriteCond %{REQUEST_URI} ^something_else_secure
- RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
- # 强制HTTP
- RewriteCond %{HTTPS} =on [OR]
- RewriteCond %{SERVER_PORT} 443
- # 某些页面强制
- RewriteCond %{REQUEST_URI} ^something_public [OR]
- RewriteCond %{REQUEST_URI} ^something_else_public
- RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
欢迎光临 一门APP开发教程 (https://bbs.yimenapp.com/) | Powered by Discuz! X3.4 |