Force SSL through web.config

Plesk Servers > SSL
If you would like to force all users to your site to use the https:// URL you can use the snippet of code below within your web.config file.  The code will need to be placed within the <system.webservers> code block, directly under the </handlers> tag.
 
<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>
 
 
 
 

Add Feedback