<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule>
source: https://www.dataplugs.com/tc/kb/使用-htaccess-檔案強制將-http-導向-https-ssl/
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule>
source: https://www.dataplugs.com/tc/kb/使用-htaccess-檔案強制將-http-導向-https-ssl/