I'm using IIS 7 to host a web application. Currently, I have a rule in the web.config that re-directs all traffic to HTTPS, however it doesn't automatically redirect traffic to www which is important for some functionality. The web.config is shown below:
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{URL}" pattern="seek\.svc$" ignoreCase="true" negate="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
Can anyone tell me how to redirect all requests to www? Either using this route or using the IIS GUI.
I've found this: IIS 6 - Setting up 301 redirect for non-www to www for SEO
Which does the trick, but creating a duplicate site seems a little messy to me. Are there any other suggestions?
thanks