我有一个托管在A2主机上的旧网站,我正在尝试将它重定向到我在GoDaddy上托管的新域。我尝试过在我的web.config上编辑“HTTPS重定向”规则,但是它仍然没有重定向。
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^www.test.gov.mp$" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://www.test.health/{R:1}" />
</rule>
</rules>
</rewrite>
test.gov.mp是我的旧域,test.health是我的新域。
发布于 2022-02-23 02:25:39
如果要将www.test.gov.mp重定向到www.test.health,可以参考此规则。该模式使用正则表达式来检查{HTTP_HOST}是否等于www.test.gov.mp,操作中的{R:1}表示域名本身后面的URL中的任何内容。
<rule name="test" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.test.gov.mp$" />
</conditions>
<action type="Redirect" url="http://www.test.health/{R:1}" />
</rule>https://stackoverflow.com/questions/71216797
复制相似问题