How to redirect from Http to Https

If you have purchased SSL Certificate and installed on your domain then you need to redirect users securely on your website and make the information protected. Then redirection plays very important role in making flow from http to https.

 

Linux:

 

If you are using linux hosting then make use of .htaccess file to redirect the valid traffic. Make sure .htaccess file present on the path where you have deployed your codes, If not found create a new one using file manager module.

 

The Redirection Rule Looks Like:

 

RewriteEngine On

RewriteCond %{HTTPS} off

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



Once you done with this user will be taken to the HTTPS version of your site.



Windows:

 

If you are using Windows based hosting then make use of web.config file to redirect the valid traffic. Make sure web.config file present on the path where you have deployed your codes, If not found create a new one using file manager module.

 

The Redirection Rule Looks Like:

 

<configuration>

<system.webServer>

<rewrite>

   <rules>

<rule name="HTTP to HTTPS redirect" stopProcessing="true">

<match url="(.*)" />

<conditions>

<add input="{HTTPS}" pattern="off" ignoreCase="true" />

</conditions>

<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />

   </rule>   

   </rules>

</rewrite>

</system.webServer>

</configuration>

 

Once you done with this user will be taken to the HTTPS version of your site.

 

Contact Us today and we will redirect your website from Http to Https