Question: I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id
However, all the company names need to map to the same "base" controllers, regardles of what the name is. I only need the companyName for authentication purposes.

Also, if there's no companyName provided, I need to map to a different set of controllers altogether.

How do I do this? I'd also appreciate a good routing resource so I don't have to ask questions like this.

Answer: 
```
routes.MapRoute(
    "CompanyRoute",                                        
    "{companyName}/{controller}/{action}/{id}",           
    new { controller = "MyBaseCompanyController", action = "Index", id = "" }  
);

routes.MapRoute(
    "NoCompanyRoute",
    "{controller}/{action}/{id}",
    new {controller = "DifferentDefaultController", action = "Index", id = "" });

```

Routing is quite a complex topic, but it's covered well in [Professional ASP.Net MVC 1.0](http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-MVC-1-0.productCd-0470384611.html). For online resources, I would suggest [starting here](http://www.asp.net/learn/mvc/#MVC_Routing), and then coming back to Stack Overflow ;)
In case if you wish to Resolve the errors caused due to routing . i suggest the following tool , which i found to be extremely useful.

[Route Debugger](http://haacked.com/archive/0001/01/01/url-routing-debugger.aspx)