How to do it...

Let's just add new routes to Startup.cs:

public void Configure(IApplicationBuilder app) 
{ 
app.UseMvc(routes => 
{ 
  routes.MapRoute( 
 name: "DomainRoute", 
 template: "home.domain.com/{action=Index}/{id?}"); 
 
  routes.MapRoute( 
 name: "DomainRoute2", 
 template: "{controller=Home}.domain.com/{id?}"); 
 
  routes.MapRoute( 
 name: "DomainRoute3", 
 template: "{controller=Home}-{action=Index}.domain.com/{id?}"); } 
} 

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.