http://からhttps://にしたとき
自動で転送させたい場合は.htaccessに記入に下記を記入する
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://sample.com/$1 [R=301,L]
</IfModule>
http://からhttps://にしたとき
自動で転送させたい場合は.htaccessに記入に下記を記入する
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://sample.com/$1 [R=301,L]
</IfModule>
俺の俺による俺のための備忘録なのでトラブルが起きても責任持てません。