Internet Information Services
Microsoft web server software.
1,629 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm setting an IIS rewrite on one of my sites. The site is accessed through multiple bindings, which are accessed via bookmarks and etc. eg:
I want them ALL to redirect to
Should this cover it?
<rewrite>
<rules>
<rule name="Redirect HTTP to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://intranet.contoso.local{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
Thanks!
Hi @sco gordo
You can try below rules:
<rules>
<rule name="Redirect HTTP to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://intranet.contoso.local{REQUEST_URI}" />
</rule>
<rule name="https to others" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTP_HOST}" pattern="^newsite.contoso.local$" />
</conditions>
<action type="Redirect" url="https://intranet.contoso.local{REQUEST_URI}" />
</rule>
</rules>