Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 3 通过web.config在IIS中进行通配符重定向_Asp.net Mvc 3_Redirect_Iis 7_Url Redirection - Fatal编程技术网

Asp.net mvc 3 通过web.config在IIS中进行通配符重定向

Asp.net mvc 3 通过web.config在IIS中进行通配符重定向,asp.net-mvc-3,redirect,iis-7,url-redirection,Asp.net Mvc 3,Redirect,Iis 7,Url Redirection,营销人员决定让我们更改页面的URL 这样的话: http://www.boyscouts.org/NewClubOpening/ http://www.boyscouts.org/NewClubOpening?c=16 http://www.boyscouts.org/NewClubOpening?c=16&s=invite [...] 应重定向到 http://www.boyscouts.org/ClubOpening/ http://www.boyscouts.org/ClubOp

营销人员决定让我们更改页面的URL

这样的话:

http://www.boyscouts.org/NewClubOpening/
http://www.boyscouts.org/NewClubOpening?c=16
http://www.boyscouts.org/NewClubOpening?c=16&s=invite
[...]
应重定向到

http://www.boyscouts.org/ClubOpening/
http://www.boyscouts.org/ClubOpening?c=16
http://www.boyscouts.org/ClubOpening?c=16&s=invite
[...]
我以前在Apache中做过这项工作,但从未使用IIS。希望有一种方法可以通过通配符实现这一点

从我收集的信息来看:

  <rewrite>
    <rules>
        <rule name="newclubopening" stopProcessing="true">
            <match url="^NewClubOpening(.+)?" />
            <action type="Redirect" url="http://www.boyscouts.org/ClubOpening{R:1}" redirectType="Found" />
        </rule>
    </rules>
</rewrite>

对吗?你们是怎么做到的


谢谢

我用IIS重定向工具测试仪测试了我的指令,结果是正确的,除了表达式开头的插入符号,我删除了它