Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Why the https to http in IIS 7.5 not working?Url Rewrite Module was installed and rules,conditions etc were applied. My web.config tag is as follows:

XML
<rules>
<rule name="Redirect to HTTP" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}/{R:1}"; redirectType="SeeOther" />
</rule>


But https not getting redirected to http.
Posted
Updated 17-May-20 21:17pm

in web.config add this code and recycle application pool of your site and restart your site in IIS

<configuration>
 <system.webServer>
 <rewrite>
 <rules>
 <rule name="HTTPS force" enabled="true" stopProcessing="true">
 <match url="(.*)" />
 <conditions>
 <add input="{HTTPS}" pattern="^OFF$" />
 </conditions>
 <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
 </rule>
 </rules>
 </rewrite>
 </system.webServer>
</configuration>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900