1

I have a http redirect in iis7 to send request to another domain. If url is something like http://www.example.com/news/ it's ok but if i try http://www.example.com/news/?id=3 then get parametes is deleted from string it's redirects to the same http://www.example.com/news/. How to save get parameters in query string with iis7?

web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com" exactDestination="false" httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>
x2.
  • 9,554
  • 6
  • 41
  • 62

1 Answers1

1

I believe you simply need to add '$S$Q' to the end of your redirect URL, e.g. destination="http://www.example.com$S$Q".

See also related StackOverflow question: How to redirect a URL path in IIS?

Community
  • 1
  • 1
Tod Flak
  • 121
  • 1
  • 5
  • You have to check the _"Redirect all requests to exact destination (instead of relative to destination)"_ too. Otherwise, the path part of the URL is appended twice. – Simon Rozman Mar 15 '17 at 08:25