I need to create this 301 redirect rule:
/blog/item.asp?n=12817
redirect to /blog/item/12817
I created a rule in IIS URL Rewrite module with these parameters :
Pattern: ^blog/item.asp\?n=([0-9]+)
redirect url: blog/item/{R:1}
When I test it in IIS it works fine and it created this rule in my web.config:
<rule name="Asp classic Legacy 301 redirect" stopProcessing="true">
<match url="^blog/item.asp\?n=([0-9]+)" />
<action type="Redirect" url="blog/item/{R:1}" appendQueryString="true" />
</rule>
But still when I navigate to /blog/item.asp?n=12817
in browser it shows me The resource cannot be found.
error with text Requested URL: /blog/item.asp
Why can it be? Do I need to switch something else somewhere?
Thanks