我在我的网站 roundabouttech.com 上做了 ssl。但问题是当我输入完整的“https://roundabouttech.com”时,它会以 https 打开。但是当我只输入“roundabouttech.com”时,它默认使用 http。我该如何解决这个问题。我的网站在 wordpress 中。
最佳答案
试试这个 htaccess 代码
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# Rewrite HTTP to HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
</IfModule>
# END WordPress
关于wordpress - 我在我的网站 roundabout tech.com 上完成了 ssl。但是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54860299/