
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>






友達を追加。