Redirect 通过IIS将www.siteName.net重定向到www.siteName.com

Redirect 通过IIS将www.siteName.net重定向到www.siteName.com,redirect,iis,Redirect,Iis,我为我的网站提交数字域。我需要通过IIS将所有域(如www.siteName.net,www.siteName.ir,www.siteName.co重定向到www.siteName.com) 这可能吗 如果不可能,当前解决方案是什么?可以使用此规则: <rule name="all domains www.siteName* to www.siteName.com" stopProcessing="true"> <match url="(.*)" /> &

我为我的网站提交数字域。我需要通过IIS将所有域(如www.siteName.netwww.siteName.irwww.siteName.co重定向到www.siteName.com

这可能吗


如果不可能,当前解决方案是什么?

可以使用此规则:

<rule name="all domains www.siteName* to www.siteName.com" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTP_HOST}" pattern="^www.siteName" ignoreCase="true" />
        <add input="{HTTP_HOST}" pattern="^www.siteName.com" negate="true" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="http://www.siteName.com/{R:1}" />
</rule>

它会将域www.siteName*的所有内容重定向到www.siteName.com