适用于已经部署完 https 证书的,类似阿里云虚机,只有首页重定向,而其他 html,js,css,image 等资源用 http 也能打开的情况。
RewriteEngine on RewriteBase / RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
「本文由 Savalone 原创或搜集整理发布,转载请遵守 CC BY-NC-ND 4.0 许可!」