我在IIS上遇到重定向问题。我在绑定到一个网站中有两个域,并且已将example1.com重定向到example.com,但我也想重定向查询
我所拥有的:
main domain: example.com
example1.com => example.com - this work
但是我想要的是
example1.com/test => example.com/test - this not working
我正在尝试:
<rule name="Rewrite domain requests" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^.*example1.com/([.a-zA-Z0-9]+)$" />
</conditions>
<action type="Rewrite" url="example.com/={R:1}" appendQueryString="true" />
</rule>
第二次尝试:
<rewrite>
<rewriteMaps>
<rewriteMap name="https://example.com/" />
</rewriteMaps>
<rules>
<rule name="Przekierowanie" stopProcessing="true">
<match url="(.*)example1.com/(.*)/" ignoreCase="false" />
<action type="Redirect" url="http://example.com/{R:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
我该怎么做?