I have a piece of JavaScript code, which when a user goes to mypage without a query string, I redirect to the same page with a specific query string.
I thought it's better to do this with an IIS URL rewrite rule, like this:
<rules>
<rule name="mypage" stopProcessing="true">
<match url="/mypage/*$" />
<action type="Redirect" url="/mypage/?category=shopping" appendQueryString="true" />
</rule>
</rules>
It's simply not working.
I tested the regex with IIS tools and it is fine, also the rewrite rule is picked by IIS, so there shouldn't be a problem there. I set appendQueryString to true and false, just in case. but it didn't work in either case.
Also, I tried both "Rewrite" and "Redirect" action types, just in case. Didn't work.
Could you please help? thanks.