限时促销 - 低至 4.75CNH/月
06
18
43
03
现在来试试吧!
×

知识库

查找有关信息功能,故障排除指南,
以及与虚拟主机相关的其他技术信息的文章。

How can I redirect my HTTP site to HTTPS?

引用:
redirect http https force https ssl

Even though You have an SSL certificate for Your website, your visitors will not use HTTPS while accessing your website by default.

You can simply add the following code to your .htaccess file, which is in your public_html folder, in order to force HTTPS:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^example1\.com [NC]

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Just don't forget to change the "example1" to your domain name.

We have a great tutorial about this here - How to Force HTTPS

IMPORTANT: If you do not have a valid SSL certificate installed, your website can become inaccessible due to this redirection. Make sure to verify your SSL is properly setup on your account by manually accessing your website with https:// to see if it works.

  • 简单易用的建站助手
  • 99.9%在线时间保证
  • 24/7 在线支持
  • Powerful Control Panel
  • 30天退款保证
限时优惠促销!
低至
4
75
CNH
/月
节省 90%
开始