它有可能有多个ReWrite规则,都做同样的行动,一个IIS7.5的networking服务器?

我有我的IIS7.5网站的重写模块的伟大工作。

现在,我希望添加一些URL,这些URL都转到HTTP 410-Gone状态。

例如。

<rule name="Old Site = image1" patternSyntax="ExactMatch" stopProcessing="true"> <match url="image/loading_large.gif"/> <match url="image/aaa.gif"/> <match url="image/bbb.gif"/> <match url="image/ccc.gif"/> <action type="CustomResponse" statusCode="410" statusReason="Gone" statusDescription="The requested resource is no longer available" /> </rule> 

但这是无效的 – 网站不开始说有一个重写configuration错误。

有另外一种方法可以做到这一点吗? 我不特别想为每个 URL定义一个URL和ACTION。

您需要匹配每个请求,然后使用条件将其过滤到您的特定URL:

 <rule name="Old Site = Image1" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAny"> <add input="{REQUEST_URI}" pattern="^(.*)image/aaa.gif$" /> <add input="{REQUEST_URI}" pattern="^(.*)image/bbb.gif$" /> <add input="{REQUEST_URI}" pattern="^(.*)image/ccc.gif$" /> </conditions> <action type="CustomResponse" statusCode="410" statusReason="Gone" statusDescription="The requested resource is no longer available" /> </rule>