IIS Redirecting non-WWW to WWW along with HTTP to HTTPS ISSUE

Last Reply 6 days ago By dharmendr

Posted 6 days 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

You are viewing reply posted by: dharmendr 6 days ago.
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html