0
votes

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.

1
Check the order of your rules. Also, this is better accomplished with your DNS registrar by forwarding the root to www.viperguynaz

1 Answers

0
votes

Enabling HTTPS for a custom domain is only available for the Standard mode of web app. Use the following steps to switch to Standard mode.

  1. In your browser, open the Azure Portal.
  2. Click the Browse option on the left side of the page.
  3. Click the Web Apps blade.
  4. Click the name of your web app.
  5. In the Essentials page, click Settings.

enter image description here

There are number of steps to enable SSL on your custom domain on Azure that you need to follow to make it work:

https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure-ssl-certificate/