2015-09-04 84 views
0

我有一个MVC的网站,我想从旧的URL重定向与查询字符串,以新的,我已经在web.config中URL重写IIS 7.0与查询字符串

<rule name="redirect boy bedding" stopProcessing="true"> 
      <match url="baby-sets" ignoreCase="true"/> 
      <conditions> 
      <add input="{QUERY_STRING}" pattern="parameters=4DB23699-69F4-46C9-AA0A-E2D5E138459C" matchType="Pattern"></add> 
      </conditions> 
      <action type="Redirect" url="/baby-sets" redirectType="Permanent"/> 
     </rule> 

,但这个规则下面的规则我总是让

enter image description here

我只是想从这个URL重定向

http://localhost:49970/baby-sets?parameters=4DB23699-69F4-46C9-AA0A-E2D5E138459C

http://localhost:49970/baby-sets

请帮助解决这个问题。

回答

0

我想通了,改变了这个

<rule name="redirect boy bedding" stopProcessing="true"> 
      <match url="baby-sets"/> 
      <conditions logicalGrouping="MatchAll"> 
      <add input="{QUERY_STRING}" pattern="parameters=4DB23699-69F4-46C9-AA0A-E2D5E138459C"/> 
      </conditions> 
      <action type="Redirect" url="baby-sets" appendQueryString="false" redirectType="Permanent"/> 
     </rule>