web.config: Redirect non-www to www

If you want to redirect your traffic from non-www to www you can put the following in your web.config:

We take the domain mytestpartner.com as an example.

<system.webServer> <rewrite>
; <rules>
;


<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" /> <conditions> <add
input="{HTTP_HOST}"
pattern="^mytestpartner$" />
</conditions> <action type="Redirect"
url="https://www.mijntestpartner..co.uk/{R:0}"
redirectType="Permanent" />
</rule> </rules>
</rewrite>