I'm trying to redirect my MVC website hosted on Azure from: https://domain.com to https://www.domain.com
domain.com redirects fine to https://www.domain.com
http://domain.com redirects fine to https://www.domain.com
But for some reason https://domain.com will not. It gives a 'This webpage is not available' 'ERR_CONNECTION_REFUSED' in chrome.
I am forcing HTTPS with the following rule in my webconfig:
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
I have seen some answers for apache but this is hosted as an Azure website.