IIS Redirect Passing Query String Parameters

By default, when you set up an entry in the IIS Webserver to have a redirect, you click the http redirect link. You then put in where you would like the visitor to end up.

So for example on this site if someone were to go to https://www.aspisfun.com I redirect them to https://aspsisfun.com without the WWW. I want all visitors to consistently be on the non-WWW version of the site for consistency sake.

However, by default this redirect does NOT pass along any query string parameters or variables. That means if a form was being called, that form data is lost.

The way to fix this is to add two parameters to your redirect destination.

https://aspisfun.com$V$Q

That $V$Q ensures the query string parameters are passed along to the new location.

While you’re at it, also make sure you enable these two options:

  1. click the checkbox for “Redirect all requests to the exact destination.”
  2. change the status code to permanent (301).

Ask with any questions!

1 Trackback / Pingback

  1. Form Data Not Submitting – www vs non-www – ASP Is Fun

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.