forum

Home / DeveloperSection / Forums / IIS Web.config 301 Redirect in ASP.NET including Parameter

IIS Web.config 301 Redirect in ASP.NET including Parameter

Anonymous User 2959 10-Nov-2014

I'm looking into using 301 redirects having noticed a bunch of hits on my domain on Google Analytics to .asp pages which not longer exist having moved everything over to a .NET setup.

Having spent a bit of time Googling, I have been able to add the following code to my web.config.

<location path="products.aspx">
    <system.webServer>
     <httpRedirect enabled="true" destination="https://www.mindstick.com/products.aspx" httpResponseStatus="Permanent" />
    </system.webServer>
</location>

This is fine and moves everything from products.asp to pproducts.aspx but it does not preserve the querystring, which is essential to make any sense, ie products.aspx?id=789 


Updated on 11-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By