I am trying to get URL rewrite in IIS 7.5 to redirect to HTTPS for a "single page". The rest of the domain should remain HTTP.
To do this, I am editing my Web.config file. Can somebody tell me what I am doing wrong in the below rule:
<system.webServer>
<rewrite>
<rules>
<rule name="SpecificRedirect" stopProcessing="true">
<match url="^register.aspx$" />
<action type="Redirect" url="https://mail.domain.org/register.aspx" />
</rule>
</rules>
</rewrite>
</system.webServer>
Below is what my URL Rewrite module looks like in IIS 7.5
thanks much.
I think you are very close, but your redirect will cause infinite loop. Try this:
<rule name="SpecificRedirect" stopProcessing="true">
<match url="^register.aspx$" />
<conditions>
<add input="{HTTPS}" pattern="^off$" />
</conditions>
<action type="Redirect" url="https://mail.domain.org/register.aspx" />
</rule>
Let me know if you have to handle multiple domains, then the rule will need more complex rewrite url.
EDIT: obviously we need Redirect not Rewrite :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With