2017-08-16 141 views
0

迄今爲止,我嘗試了多種組合,但沒有運氣。我有一個像下面的URL。更改IIS URL重寫規則中的查詢字符串值

https://teams.company.com/Search/pages/results.aspx?url=https://teams2017.company.com/sites/hrdepartment 

我想創建一個規則,將查詢字符串值從teams2017只,像下面改變。

https://teams.company.com/Search/pages/results.aspx?url=https://teams.company.com/sites/hrdepartment 

我正在使用安裝了IIS重寫規則的IIS 8.5。

回答

1

您的規則應該是這樣的:

<rule name="teams2017 to teams" stopProcessing="true"> 
    <match url="^Search/pages/results.aspx$" /> 
    <conditions> 
     <add input="{QUERY_STRING}" pattern="(.*)teams2017(\.company\.com.*)" /> 
    </conditions> 
    <action type="Redirect" url="{R:0}?{C:1}teams{C:2}" appendQueryString="false" /> 
</rule> 
+0

我不知道你們是如何做到這一點,但它的輝煌。非常感謝Victor幫助我。這真的很有幫助。我希望我能以一種簡單的方式學習這一點。再次非常感謝。 :) –