2015-09-04 94 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>