I'm really struggling with this. I have tried no end of examples and everything I read tells me this should work, however, I'm no server expert so I may well have made some incorrect assumptions about what I have done.
Quite simply I have a site at https://xxxxx.co.uk if someone types in
I want them to be redirected to https://xxxxx.co.uk
Currently, I can get the Http to https working but not the www to non-www part (with or without the https bit). It just stays on the www.xxxxx.co.uk (http://www and https://www) and tells me about a security risk which makes sense. But I want it to go to my site.
Any help would be much appreciated as I have been at this all day.
I found this article enter link description here which covers nearly all scenarios except https://www.xxxxx.co.uk. This rule just doesn't seem to want to work
<system.webServer>
<rewrite>
<rules>
<rule name="RedirectWwwToNonWww" stopProcessing="false">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
</conditions>
<action type="Redirect" url="https://xxxxx.co.uk" redirectType="Permanent" />
</rule>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>