Forum Discussion
Jim_P23
Feb 01, 2023Copper Contributor
using IIS URL Rewrite module for HTTP to HTTPS
I have installed the URL Rewrite module in IIS 10 to redirect HTTP calls to HTTPS, and I have attempted to set up the redirect but have not gotten it working on one server. Here is the issue: ...
KapildevMishra
Feb 06, 2023Copper Contributor
Hello Jim_p23
kindly use below code which help you to achieve your goal.
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
kindly use below code which help you to achieve your goal.
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
Jim_P23
Feb 07, 2023Copper Contributor
Thank you for the reply.
I was able to get it to work. I had only set up HTTPS bindings but I also needed to have HTTP bindings enabled before it worked.
Thank you again,
Jim