Is there a way to map the Areas within an ASP.NET MVC 2 application to subdomains such as
movies.example.com/Theater/View/2
instead of
You can map domains or subdomains to an MVC2 Area easily using the IIS7 URL Rewrite module. Here are two simple rules that map subdomains to two Areas. I added a restriction to not use this rule if the request is for an actual file (i.e. CSS, JS, or image files).
Here is the sample config that goes right in your web.config:
You'll have to change the rules below to work with your particular use case. Especially if you have controllers on the root area that you need to use. In that case, just add a condition or create a new rule.
Download the IIS URL Rewrite module (required): http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/