Iis 7 iis7从准确的url重定向到新站点
我想从一个确切的URL请求重新定向到该域中的一个新站点 我需要重新引导来自的请求Iis 7 iis7从准确的url重定向到新站点,iis-7,http-redirect,Iis 7,Http Redirect,我想从一个确切的URL请求重新定向到该域中的一个新站点 我需要重新引导来自的请求 www.example.com/site111/default.aspx?configX.xml (此网站使用不同的配置文件加载内容) 到 问题是我需要离开访问权限www.example.com.au/site111/default.aspx 因此,我不能只对http重新定向,因为没有名为default.aspx?configX.xml的文件 我想我需要使用URL重写重新定向 有人能帮我一下web配置的语法吗
www.example.com/site111/default.aspx?configX.xml
(此网站使用不同的配置文件加载内容)
到
问题是我需要离开访问权限www.example.com.au/site111/default.aspx
因此,我不能只对http重新定向,因为没有名为default.aspx?configX.xml的文件
我想我需要使用URL重写重新定向
有人能帮我一下web配置的语法吗?我无法让它工作
0模块已安装并使用了上述语法,但仍然无法正常工作 如果我在模块上使用测试功能,它会说字符串匹配, 很困惑,, 这里是实际的webconfig部分
<rewrite>
<rules>
<rule name="Redirect2" stopProcessing="true">
<match url="\/nrmmaps\/default.aspx\?config=nrmproject.xml$" />
<action type="Redirect" url="/nrmproject/default.aspx" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
我想让它重新指向
你知道为什么这不起作用吗?我认为你需要安装IIS重写模块,可以在这里找到:
完成此操作后,您可以在web.config中添加一个带有重定向规则的重写部分,如下所示:
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url="\/site111\/default.aspx\?configX.xml$" />
<action type="Redirect" url="/site222/default.aspx" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
</system.webServer>
希望这有助于在新答案中评论太多,无法在此处写入
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url="\/site111\/default.aspx\?configX.xml$" />
<action type="Redirect" url="/site222/default.aspx" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
</system.webServer>