How to Redirect HTTP visitors to HTTPS?

If you already have an SSL certificate on your website and you need all the HTTP visitors to be automatically redirected to the secured (HTTPS) version of the website to make sure the communications are encrypted, here is the how-to for this purpose. Please follow these steps. 

Our shared hosting is using Windows Server systems with IIS. After the SSL certificate is installed on your website, you may add a URL redirect rule in the web.config file for automatic HTTPS redirection.
 
> Please open the web.config file, using your text editor.
> The URL rewrite rule for HTTPS redirection to be added is as the following...
 
<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="Found" url="https://{HTTP_HOST}/{R:1}" />
                 </rule>   
            </rules>
    </rewrite>
    </system.webserver>
    </configuration>
 
version 2
 
<system.webServer>
<rewrite>
<rules>
<rule name="http redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
 
> Simply please copy the rule to your web.config file and save the change.
> Please upload the saved web.config file to the webserver that hosts your website through FTP or via File Manager of your control panel account.
> The new rule takes effect immediately when the file has been uploaded.
 
 
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to secure your WordPress?

WordPress is an open-source application so security level issues you may face but Do not worry...

Install themes into the wordpress

What is the WordPress theme? A WordPress Theme is a collection of files that work together to...

Top 5 e-commerce applications

What is e-commerce?   E-commerce (electronic commerce) is the buying and selling of goods and...

How to Install Wordpress Website?

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL....

How To Check DotNetNuke Install Instance Version?

> Please login to your DNN site with your host account. > Please Navigate to Host >...

Powered by WHMCompleteSolution