I would like to rewrite a subdomain so it is passed as a querystring to a site. Take the following scenario.
IIS Config:
Site A (bindings: *, site-a.com)
Site B (bindings: site-b.com)
Rewrite rules:
"sub1.site-a.com" -- rewrite to -> "site-a.com"
"sub2.site-a.com" -- rewrite to -> "site-a.com"
"sub1.site-b.com" -- rewrite to -> "site-b.com?subdomain=sub1"
"sub2.site-b.com" -- rewrite to -> "site-b.com?subdomain=sub2"
If I make the rewrite rules in the IIS server settings, site-a.com will capture all the rewrites because the original url match the default binding on site-a.com instead of matching the bindings against the rewritten urls. Is there any way around this behavior?