【发布时间】:2020-11-16 08:54:05
【问题描述】:
我有两个域 baddomain.com 和 gooddomain.com 指向同一个托管服务。我已经购买了 SSL 证书,现在我想将坏的证书重定向到安装了 SSL 的好证书。我编写了这些规则,它适用于 Chrome,但不适用于 IE 和 firefox。坏域重定向到 https 而不是重定向到好域。谢谢。
<!--Redirect from bad domain to good one-->
<rule name="BadtoGood" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="baddomain.com" />
</conditions>
<action type="Redirect" url="https://gooddomain.com/{R:0}" redirectType="Permanent" />
</rule>
<!--Force https on good domain -->
<rule name="forceHTTPS" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" negate="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
</conditions>
<action type="Redirect" url="https://gooddomain.com/{R:0}" redirectType="Permanent" />
</rule>
【问题讨论】: