Skip options using <httpRedirect> in ASP.Net

On my ASP.Net site, I constantly redirect the URL to another location using <httpRedirect> in the web configuration.
I am reading the URL value from the table and redirecting to that URL using Response.Redirect( URL );
It works great.
But now when I try to send the parameter to the calling page using:

 Response.Redirect("Default.aspx?name=stackoverflow"); 

<httpRedirect> in web.config calls Default2.aspx because of the following code in web.config:

 <location path="Default.aspx"> <system.webServer> <httpRedirect enabled="true" destination="Default2.aspx" httpResponseStatus="Permanent" /> </system.webServer> </location> 

Problem Default2.aspx does not receive any parameters.
Please, help.

Note. I cannot use the session variable, since the contents of the page depend on this parameter.

For instance,
If the user opens another page in a new tab using Default.aspx?name=MetaStackOverflow , the session variable will be replaced, and if the first page is updated, instead of displaying the contents of Stackoverflow will be displayed.

+4
source share
1 answer

Do not forget the special characters $ V $ Q, and for a precise definition, you must set the value to True.

<location path="Help"> <system.webServer> <httpRedirect enabled="true" destination="/Redirect.aspx$V$Q" httpResponseStatus="Permanent" exactDestination="true" /> </system.webServer> </location>

+5
source

All Articles