Set Start Page in IIS Server in ASP.Net

Last Reply 3 months ago By dharmendr

Posted 3 months ago

I want to redirect non-WWW to WWW along with HTTP to HTTPS in IIS 8.5. if users type http://example.comhttp://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