IIS web.config旧URL到新的URLredirect

我是新来redirect,并很难得到这些工作,我有一个旧站点需要redirect到一个新的网站,相同的域名,但不同的文件夹和域string约1400的URL。 这是我目前没有工作,任何帮助,不胜感激。

谢谢

<rule name="Redirect0001" patternSyntax="ExactMatch" stopProcessing="true"> <match url="www.sitename.com/index.html/_10_12_Slotted_Screwdriver_Bit_2_long?SCREEN=product_ordering&amp;ScreenID=2464&amp;ProductID=952" /> <conditions> <add input="{HTTP_HOST}{REQUEST_URI}" pattern="www.sitename.com/index.html/_10_12_Slotted_Screwdriver_Bit_2_long?SCREEN=product_ordering&amp;ScreenID=2464&amp;ProductID=952" /> </conditions> <action type="Redirect" url="http://www.sitename.com/items.aspx?category=Screwdriver+Bits%2c+Nutsetters+%26+Holders&amp;id=203" /> </rule> 

几件事情。

  1. 你只想匹配匹配url后的/
  2. 您不希望将查询string包含在匹配url中

所以,试试这个规则。 它匹配从index.html/...开始,并在匹配条件中使用查询string。

 <rule name="Redirect0001" patternSyntax="ExactMatch" stopProcessing="true"> <match url="index.html/_10_12_Slotted_Screwdriver_Bit_2_long" /> <conditions logicalGrouping="MatchAll"> <add input="{QUERY_STRING}" pattern="SCREEN=product_ordering&amp;ScreenID=2464&amp;ProductID=952" /> </conditions> <action type="Redirect" url="http://www.mysite.com/items.aspx?category=Screwdriver+Bits%2c+Nutsetters+%26+Holders&amp;id=203" appendQueryString="false" /> </rule> 

然而,增加1400个这些看起来相当乏味。 我会看看是否有一种方法可以将它们分解为查询string模式。