使用 .htaccess 導向 HTTPS

使用 .htaccess 導向 HTTPS

增加網站安全性
於網站根目錄放上 .htaccess
使所有 http 連線導向 https

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Comments are closed.