IIS 7 URL Rewrite doesn't work if the url has

2019-02-25 12:10发布

问题:

I'm using the URL rewrite feature of IIS7

I'm trying redirect a URL like this

example.com/?parameter=abc 

to a URL like this

example.com/somedirectory

the URL redirect works well if the source URL doesn't contain a question mark in it.

pls help

-Vivek

回答1:

IIS7 redirects don't by default match query strings in the pattern so you have to add a condition as well as the pattern with {QUERY_STRING} matches the pattern parameter=abc