Limited Time Offer - from £0.99/month
00
DAYS
03
HOURS
36
MINUTES
17
SECONDS
Get Started
×

Knowledge base

Find articles and information about all features, troubleshooting guides,
and other technical information on Hostinger's hosting services.

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.

  • Easy Website Builder
  • 99.9% Uptime Guarantee
  • 24/7 Live Support
  • Powerful Control Panel
  • 30-Days Money-Back Guarantee
Limited Time Special Offer!
From
£
0
99
/mo
Save 90%
Get it!