I'm trying to configure redirects to prepare the switch from an ASP to an MVC website. The IIS wildcard redirects are working fine, but I cannot figure out how to preserve the query parameters.
Example:
<system.webServer>
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Permanent">
<add wildcard="/EmailAddress-Verify.aspx" destination="https://foo.com/account/email-verify$Q" />
</httpRedirect>
</system.webServer>
I read that $Q
will preserve the query params but it's not working. Google could not find anything on that issue.. is there anything I'm missing here?
Thanks!
Y̶o̶u̶ ̶h̶a̶v̶e̶ ̶e̶x̶a̶c̶t̶D̶e̶s̶t̶i̶n̶a̶t̶i̶o̶n̶=̶"̶t̶r̶u̶e̶"̶.̶ However, more importantly, when you want to have more granular control with redirects, you're much better off using the URL Rewrite module. Your bit would be something like the following (not tested and quickly written up):
Oh, now that I think about it, you could probably just do a straight up pattern without the following wildcard and just appendQueryString="True" in the action.