vendredi 19 juillet 2019

Http to Https looping recursively in IIS 10

I have a web application which was developed in ASP.net web form and hosted in IIS 10. It was in Form Authentication mode.

I have installed SSL certificate in the server IIS. But while using HTTPS redirects rule it is redirecting recursively from HTTP to HTTPS and vice versa. At last i am getting error in Browser "Too many redircts"

I have tried so many rules one by one from the web and applied in the URLRewrite but nothing works. I have given one rule here which was i tried but not works

<rewrite>
      <rules>
          <clear />
          <rule name="Redirect to https" enabled="true" stopProcessing="true">
              <match url="(.*)" />
              <conditions>
                  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
              </conditions>
              <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="true" />
          </rule>
      </rules>
  </rewrite>

Actually i need my site should redirect automatically http to https. That's it.

Thanks in advance for your suggestions

Aucun commentaire:

Enregistrer un commentaire