到目前为止,我尝试了多种组合,但没有运气。我有一个如下的网址。
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。
答案 0 :(得分:2)
你的规则应该是这样的:
<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>