Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top