-1

I have already created a topic about query strings, unfortunately the question was closed and no one answers anymore.

For example, I want to redirect from splash.aspx?page=3 to a simpler url e.g. to splash3.aspx. I unfortunately have no backend code where the query string can respond, so I need an alternative. How can I configure url rewrite?

tm3241
  • 11
  • 2
  • You can get plenty of hints from previous discussions, like https://stackoverflow.com/questions/2257403/iis-url-rewrite-module-redirect-based-on-querystring and that's why your questions were downvoted or closed. – Lex Li Jul 18 '22 at 13:51
  • You tagged your question with the URL rewrite module, so you seem to know of its existence. Did you try looking at the documentation for that? Implementing it in your project? What did you manage to come up with, and what's not working about it? – mason Jul 18 '22 at 14:00

1 Answers1

0

In your web.config, add the following nodes:

<rewrite>
  <rule name="Redirect splash page 3" stopProcessing="true">
    <match url="splash\.aspx$" />
    <conditions>
      <add input="{QUERY_STRING}" pattern="page=3" />
    </conditions>
    <action type="Redirect" url="splash3.aspx" redirectType="Temporary" />
  </rule>
</rewrite>

For more information see https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

Geoffrey McGrath
  • 1,663
  • 1
  • 14
  • 35
  • Thank you! This works great! But what if I have "resultslist.aspx?ln=en&id=0&LinkId=critical&TocIndex=" and I want to redirect to resultslist0.aspx – tm3241 Jul 18 '22 at 21:31