Monday, September 3, 2018

cpanel: 自動將http轉到https

在目錄下加入.htaccess,並輸入以下內容︰
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Reference: Redirect HTTP to HTTPS automatically

No comments: