We have a CMS where we host multiple sites under the various subdomains but with the same main domain:
Example:
sub1.mysite.com
sub2.mysite.com
This being the same application they share the same web.config. So when I try to write a rewrite rule and a similar match exists in another subdomain site, the rewrites take affect for all sites.
What I want is to match on the base level domain (mysite.com or sub.mysite.com) and make my rewrite rules?
All the answers I find say to use something like
<match url="^(.*)$" ignoreCase="true" />
or <match url="^mypage/?(.*)$" />
or <match url="^mypage/mysubpage//?(.*)$" />
But the problem with looking at any of these is that the carat '^' is kind of a wild card and not domain/subdomain specific.
Lets say I want to have a rewrite rule for
mysite.com/about-us
and a sub domain site has a page named the same
sub1.mysite.com/about-us
BUT I ONLY want to a rewrite for the main mysite.com/about-us and NOT have the sub1.mysite.com/about-us site have the same rewrite rule.
How would I tell it that I only want mysite.com/about-us to rewrite to mysite.com/about/about-us?