From 6c37129a321fa36d23943b650afc3938cd5a72a9 Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Sun, 22 Nov 2015 23:13:55 -0800 Subject: [PATCH] Fixed dev routing --- Teknik/Areas/About/AboutAreaRegistration.cs | 6 ++++++ Teknik/Areas/Blog/BlogAreaRegistration.cs | 6 ++++++ Teknik/Areas/Dev/DevAreaRegistration.cs | 8 +++++++- Teknik/Areas/Home/HomeAreaRegistration.cs | 8 +++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Teknik/Areas/About/AboutAreaRegistration.cs b/Teknik/Areas/About/AboutAreaRegistration.cs index ee9572a..29c26e6 100644 --- a/Teknik/Areas/About/AboutAreaRegistration.cs +++ b/Teknik/Areas/About/AboutAreaRegistration.cs @@ -14,6 +14,12 @@ namespace Teknik.Areas.About public override void RegisterArea(AreaRegistrationContext context) { + context.MapSubdomainRoute( + "About_dev", // Route name + "dev", + "About/{controller}/{action}", // URL with parameters + new { area = "About", controller = "About", action = "Index" } // Parameter defaults + ); context.MapSubdomainRoute( "About_default", // Route name "about", diff --git a/Teknik/Areas/Blog/BlogAreaRegistration.cs b/Teknik/Areas/Blog/BlogAreaRegistration.cs index 821764c..f4f5bec 100644 --- a/Teknik/Areas/Blog/BlogAreaRegistration.cs +++ b/Teknik/Areas/Blog/BlogAreaRegistration.cs @@ -20,6 +20,12 @@ namespace Teknik.Areas.Blog // "blog/{controller}/{action}/{username}/{page}", // URL with parameters // new { subdomain = "blog", area = this.AreaName, controller = "Blog", action = "Index", username = UrlParameter.Optional, page = UrlParameter.Optional } // Parameter defaults // ); + context.MapSubdomainRoute( + "Blog_dev", // Route name + "dev", + "Blog/{controller}/{action}", // URL with parameters + new { area = "Blog", controller = "Blog", action = "Index" } // Parameter defaults + ); context.MapSubdomainRoute( "Blog_default", // Route name "blog", diff --git a/Teknik/Areas/Dev/DevAreaRegistration.cs b/Teknik/Areas/Dev/DevAreaRegistration.cs index dfa708e..d225234 100644 --- a/Teknik/Areas/Dev/DevAreaRegistration.cs +++ b/Teknik/Areas/Dev/DevAreaRegistration.cs @@ -18,7 +18,13 @@ namespace Teknik.Areas.Dev context.MapSubdomainRoute( "Dev_subdomain", // Route name "dev", - "{area}/{controller}/{action}", // URL with parameters + "Dev/{controller}/{action}", // URL with parameters + new { area = "Dev", controller = "Dev", action = "Index" } // Parameter defaults + ); + context.MapSubdomainRoute( + "Dev_default", // Route name + "dev", + "", // URL with parameters new { area = "Home", controller = "Home", action = "Index" } // Parameter defaults ); //context.MapRoute( diff --git a/Teknik/Areas/Home/HomeAreaRegistration.cs b/Teknik/Areas/Home/HomeAreaRegistration.cs index daebd28..d90c2a8 100644 --- a/Teknik/Areas/Home/HomeAreaRegistration.cs +++ b/Teknik/Areas/Home/HomeAreaRegistration.cs @@ -17,12 +17,18 @@ namespace Teknik.Areas.Home { context.MapSubdomainRoute( "Home_dev", // Route name + "dev", + "Home/{controller}/{action}", // URL with parameters + new { area = "Home", controller = "Home", action = "Index" } // Parameter defaults + ); + context.MapSubdomainRoute( + "Home_subdomain", // Route name "www", "{controller}/{action}", // URL with parameters new { area = this.AreaName, controller = "Home", action = "Index" } // Parameter defaults ); context.MapSubdomainRoute( - "Home_subdomain", // Route name + "Home_default", // Route name null, "{controller}/{action}", // URL with parameters new { area = this.AreaName, controller = "Home", action = "Index" } // Parameter defaults