I created Admin Area inside my ASP.NET Core application and updated my routes like that:
app.UseMvc(routes =>
{
routes.MapRoute(name: \"areaRoute\",
Good solution Sergio was able to create the subdomain routing. Just to add to your solution and to complete the subdomain route to the physical directory.
public class HomeController : Controller
{
public async Task Index(int? id, string subdomain)
{
if (!string.IsNullOrWhiteSpace(subdomain))
{
if(subdomain=="admin")
return View("~/wwwrootadmin/index.cshtml");
}
return View("~/wwwroot/index.cshtml");
}
}
Then wwwrootadmin has to be created with your files for the subdomain. Remember the order of route order matters inside the app.UseMvc()