IIS将所有请求重写为静态URL

Max*_*lli 6 iis url-rewriting

我有http://xyz.it/page1http://xyz.it/pageN,我需要将所有页面重定向到http://bar.it/foo,我想我已经用这个规则解决了它:

    <rule name="from-xyz-to-bar" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAny">
            <add input="{HTTP_HOST}" pattern="^xyz\.it$" />
        </conditions>
        <action type="Redirect" url="http://bar.it/foo" appendQueryString="false" redirectType="Permanent" />
    </rule>
Run Code Online (Sandbox Code Playgroud)

但它不起作用.我的规则是将http://xyz.it/page1重定向到http://bar.it/page1,我不明白我错在哪里.

请帮忙!

dav*_*rey 2

<rule name="from-xyz-to-bar" stopProcessing="true">
    <match url="^$" />
    <action type="Redirect" url="http://bar.it/foo" />
</rule>
Run Code Online (Sandbox Code Playgroud)