首页 > 解决方案 > 重定向域作品但不重定向页面

问题描述

在我的 web.config 中,我有几个正常工作的规则。我有下面的一个,它是我优先考虑的第二个。域重定向正常。但是,www.olddomain.com/aboutus 会重定向到 www.newdomain.com/newpageaboutus。我需要它将所有请求重定向到 www.newdomain.com/newpage 的静态页面。

            <rule name="olddomain.com" enabled="true">
                <match url="(.*)" ignoreCase="true" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{HTTP_HOST}" matchType="Pattern" pattern="^.*olddomain\.com$" />
                </conditions>
                <action type="Redirect" url="https://www.newdomain.com/newpage" redirectType="Permanent" appendQueryString="false" />
            </rule> 

谢谢。

标签: iisurl-rewritingiis-8

解决方案


这是我的错误。我从一台主机到另一台主机的重定向包括新页面链接。对不起。但是,我认为将来添加 stopProcessing="true" 会解决这个问题。


推荐阅读