Question

I wish all requests to www.liamblizard.co.uk to be redirected to liamblizard.co.uk

This is the rule i've got in web.config to do the rewrite

<rule name="Canonical Hostname" stopProcessing="false">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
      </conditions>
      <action type="Redirect" url="http://{C:2}{REQUEST_URI}" redirectType="Permanent" />
    </rule>

but all requests to www.liamblizard.co.uk fail

enter image description here

Do I need to do anything at the DNS level, ie: CNAME records, or should that IIS rule take care of everything?

The site is an Azure Standard Website if that matters.

Was it helpful?

Solution

At your DNS, update the www CNAME record to point to liamblizard.co.uk

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top