English 中文(简体)
iis 7 relative redirect with get parameters
原标题:

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>
问题回答

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?





相关问题
session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

How to use appcmd to set debug=false in IIS7

I m trying to use APPCMD to set debug=false in web.config, per the documentation. The specific syntax I am using is: APPCMD SET CONFIG "SITE/VDIR" section:compilation /debug:False /commit:APP ...

Windows User Account that executes only IIS7 Provisions

I have a web application that executes IIS 7 provisions (using Microsoft.Web.Administration.dll) to create our web and ftp sites. When I run this using the administrator account, it works ok. I want ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

IIS 7 Http Handler development issue

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 to develop an ASP.Net web site. I want to develop an Http module, which could inspect whether incoming request has some specific http header (e.g. ...

热门标签