How to redirect non-www to www with https

Add this snippet to your web.config file IF you have your own SSL certificate on our server.  If you are using the sophio.com wildcard SSL certificate this will not work.

<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

Note:  Be sure to make a backup of your web.config BEFORE you edit it.  This snippet goes in the 

<system.webServer>
<rewrite>
<rules>

add snippet here

</rules>

Was this answer helpful? 0 Users Found This Useful (0 Votes)