Redirect 如何在IIS中将www.mypage.com/this/that重定向到www.mypage.com

Redirect 如何在IIS中将www.mypage.com/this/that重定向到www.mypage.com,redirect,iis,Redirect,Iis,我应该在操作url中添加什么,以便将其重定向到当前域 试图将www.mypage.com/this/that/whatever.aspx转到此www.mypage.com如果您想重定向到主页,您可以使用/。看起来是这样的 <rule name="url rewrite" stopProcessing="true"> <match url="This/That/Something(.*)$" />

我应该在操作url中添加什么,以便将其重定向到当前域


试图将www.mypage.com/this/that/whatever.aspx转到此www.mypage.com

如果您想重定向到主页,您可以使用
/
。看起来是这样的

<rule name="url rewrite"
                    stopProcessing="true">
                <match url="This/That/Something(.*)$" />
                <action type="Redirect"
                       url="" />
            </rule>
如果您想重定向到另一个域
www.otherdomain.com
,您应该这样使用它:

<rule name="url rewrite" stopProcessing="true">
    <match url="This/That/Something(.*)$" />
    <action type="Redirect" url="/" />
</rule>
<rule name="url rewrite" stopProcessing="true">
    <match url="This/That/Something(.*)$" />
    <action type="Redirect" url="/abc" />
</rule>

<rule name="url rewrite" stopProcessing="true">
    <match url="This/That/Something(.*)$" />
    <action type="Redirect" url="http://www.otherdomain.com" />
</rule>