1. Create web.config file in root directory of website ( if not exists ).
  2. Paste the following code at the new line in web.config file.
<?xml version="1.0" encoding="UTF-8"?>
<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>

Advertisements