Redirecting HTTP to HTTPS

With so many benefits of installing an SSL certificate – including enhanced security and better search engine rankings – a growing number of website owners are moving in this direction.

Once you install an SSL certificate, your website is available over both HTTP and HTTPS.

While you’re not required to make any additional changes, it’s important to force HTTPS instead of HTTP. By doing so, you’ll redirect all your visitors to the encrypted version of your website.

There’s no requirement to install an SSL certificate, but Google recommends it because the encryption helps keep your users secure.

Getting Started

Before you can redirect HTTP to HTTPS, you’ll want to secure a valid SSL certificate. There are many providers of SSL certificates, so be sure to compare your options based on reliability, reputation, and cost.

Also, you need access to your hosting account control panel, as this is where you’ll make the necessary changes.

Here are the two steps to take to complete the redirect:

1. Locate and Edit .htaccess

The first step is to locate or create the .htaccess file. This is where you will enter the redirection code.
If you need any assistance finding this, contact your hosting company to walk you through the process.

2. Add the Redirection Code

Now that you’ve gained access to the .htaccess file, you can force all future traffic to use HTTPS by inserting the following code:

RewriteEngine On

RewriteCond %{HTTPS} off

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

Tip: you may have existing code in your .htaccess file, so be careful to not repeat “RewriteEngine On.” If this already exists, omit it the second time and simply copy in the other two lines.


Once you have an SSL certificate, you can then take these two simple steps to redirect HTTP to HTTPS. By doing so, you’re guaranteed of directing all traffic to the most secure version of your website.

Leave a Reply

Your email address will not be published. Required fields are marked *