I asked a previous question about how to have multiple subdomains all pointing at the same site; the answer I accepted there was to use URL Rewrite.
Cool. But for the life of me I cannot figure out how URL Rewrite works, and I consider myself a relatively smart guy. |-) Lots of questions...
- Each customer (and there will be hundreds, if not thousands) gets their own subdomain e.g.
customer1.mydomain.com
,cooldude.mydomain.com
etc. The regex would be(.+)\.mydomain\.com
, and all of these URLs should be redirected to a website on IIS that I've namedcustomers.mydomain.com
. All the examples I've found on URL Rewrite are about referencing documents, e.g.mydomain.com/thing.aspx?id=123
changes tomydomain.com/thing/123
, which I'm not really interested in. Here's a clue: as you can see in the picture below, the "Input" column always says "URL path after '/'" - but there doesn't appear to be any way to change that.
- I am assuming that the rewrite rule should be put on the default web site, but I want the rule to redirect to the
customers.mydomain.com
web site. How do you force the redirect to a specific web site, in such a way that I will still be able to see the subdomain name (which determines the customer site I'm logging into)?