Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used below code in web config

XML
<rewrite>
          <rules>
               <rule name="redirecthttps" stopProcessing="true">
                   <match url="(.*)" />
                   <conditions>

                       <add input="{HTTPS}" pattern="^off$" />
                   </conditions>
                   <action type="Redirect" url="https://{HTTP-HOST}/{R:1}"/>
               </rule>
           </rules>
   </rewrite>



but not redirect to https, what's wrong in my code
Posted
Updated 8-Apr-15 5:23am
v2

1 solution

Try using "off" instead of "^off$" in the pattern:
XML
<conditions>
    <add input="{HTTPS}" pattern="off" />
</conditions>
 
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