3

I have tried multiple combinations so far but no luck. I have a URL like below.

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

I want to create a rule that will change the query string value from teams2017 to teams only, like below.

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

I am using IIS 8.5 with IIS Rewrite rule installed.

1 Answer 1

5

You rule should be like that:

<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>
Sign up to request clarification or add additional context in comments.

1 Comment

I don't know how you guys do this but its brilliant. A big thanks Victor for helping me out. It was really helpful. I wish i could learn this in some easy way. Once again thanks much. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.