Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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
IIS Url重定向匹配模式_Url_Iis_Iis 7_Url Rewrite Module - Fatal编程技术网

IIS Url重定向匹配模式

IIS Url重定向匹配模式,url,iis,iis-7,url-rewrite-module,Url,Iis,Iis 7,Url Rewrite Module,我正在重定向配置文件中的URL。这就是我正在做的: <rule name="award temp redirect" stopProcessing="true"> <match url="(.*?)/?award.aspx$" /> <action type="Redirect" url="http://www.abc.com.au/award.aspx" redirectType="Temporary" /> </rule>

我正在重定向配置文件中的URL。这就是我正在做的:

<rule name="award temp redirect"  stopProcessing="true">
    <match url="(.*?)/?award.aspx$" />
    <action type="Redirect" url="http://www.abc.com.au/award.aspx" redirectType="Temporary" />
</rule>

这对于
/award.aspx
来说效果很好,但我想为
/awards
/award
添加一些功能。目前,我已经为
/awards
/awards
创建了单独的规则


我可以把这两个加在一个匹配中吗。如果Url是
/award.aspx
/award
/awards
,则重定向到
http://www.abc.com.au/award.aspx

匹配
接受
url
值的正则表达式。尝试:

<match url="(.*?)/?awards?(\.aspx)?$" />


这只是一个例子。您可以匹配您想要的任何内容。

谢谢如果我想添加TestWard或TestWard.aspx怎么办?对不起,它不是TestWard,我想匹配它的/test或/test.aspx。很抱歉,给您带来了困惑@lorond
<match url="(.*?)/?(awards?|test)(\.aspx)?$" />