How do I IIS redirect only one domain on SSL?

IIS redirect only one domain on SSL:

For the particular domain redirection we need to add an additional condition to rewrite rule, Which will check the host:
Viz:
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?viastudy.com" />
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
Note: I have done for the viastudy.com domain.
Thanks

Post a Comment

0 Comments