【发布时间】:2018-08-29 03:28:42
【问题描述】:
如何将我的网站重定向到 https? 我已经在 cpanel 域上设置了 -> 重定向
这是我的 .htaccess 代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
但是当我输入 mydomain.com 时,它不会重定向到 www.mydomain.com 正因为如此,我得到了糟糕的证书。 有人可以知道我为什么要为我的网站使用这个吗?
【问题讨论】:
标签: apache .htaccess http mod-rewrite https