I want to redirect non-WWW to WWW along with HTTP to HTTPS in IIS 8.5. if users type http://example.com, http://www.example.com, or https://example.com, they all redirect to https://www.example.com.
This is what i did in web.config
<rewrite>
<rules>
<rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^[^www]" />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
But i get the iis start page instead of my default.aspx page, in IIS i use 1 site binding which is example.com