logo

Black Friday
Sale

  •  99.9% 가동시간
  •  무료 SSL 인증서
  •  24/7 라이브 지원
  •  30일 환불 보증
시작하세요

최대

90

%

OFF

45
02
46
16
블랙프라이데이 세일: 저렴한 웹 호스팅
부터 895원 /달!
전체 상품 보기
×

지식저장소

Find articles about information features, troubleshooting guides,
and other technical information related to the hosting service Hostinger.

How can I redirect my HTTP site to HTTPS?

Modified on:
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.