
Apache + .htaccess
.htaccessファイルに以下のルールを追加して強制できます。https訪問者:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
変更された.htaccessファイルは以下のとおりです。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#HTTPSを強制するルールを追加
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>






友達を追加。