I'm trying to find out how to write IIS URL Rewrite rule to redirect by the following rule:
For example:s1.mysite.com/mypage.aspx?p=1
should be redirected to www.mysite.com/mypage.aspx?p=1
.
But this redirection rule, should only work if URL starts with one of the following:
"s1", "s2", "s5" and contains ".aspx".
I started to write some Regex pattern for that "(s1\.|s2\.|s5\.)+(.)*(\.aspx)+"
, but actually, I don't even know if I'm on correct way.
After I will have the regex
pattern, how I can tell IIS
to redirect to exactly same url, just instead s1|s2|s5
it must be www
.