开发者

iis 7 relative redirect with get parameters

开发者 https://www.devze.com 2023-01-12 12:03 出处:网络
I have a http redirect in iis7to 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 del

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"?&g开发者_StackOverflow社区t;
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com" exactDestination="false" httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消