using System; using System.Configuration; using System.Web.Mvc; using System.Web.Routing; namespace DR.FV2016.Web { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { var webCmsUrl = ConfigurationManager.AppSettings["WebCmsUrl"]; if (string.IsNullOrEmpty(webCmsUrl)) throw new ConfigurationErrorsException("WebCmsUrl appSetting is not present (or is empty) in your web.config. Fix plx!"); var webCmsUri = new Uri(webCmsUrl); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); var siteDisabled = ConfigurationManager.AppSettings["SiteDisabled"] == "true"; //var externalBannerDisabled = ConfigurationManager.AppSettings["ExternalBannerDisabled"] == "true"; //if (externalBannerDisabled ) //routes.MapRoute("BannerNotFound", "services/externalmodules/banner", new { controller = "Status", action = "PageNotFound" }); if (siteDisabled) routes.MapRoute("NotFound", "{*url}", new { controller = "Status", action = "PageNotFound" }); routes.MapRoute(name: "ExternalBanner", url: "services/externalmodules/banner", defaults: new { controller = "ExternalModules", action = "Banner" }); routes.MapRoute(name: "TimestampJson", url: "services/externalmodules/timestamp", defaults: new { controller = "ExternalModules", action = "TimestampJson" }); routes.MapRoute( "Default", // Route name "comp/{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); //var cmsRoutings = new List(); //WebCmsRouteConfig.RegisterCmsRoutes(cmsRoutings); MvcRouteConfig.RegisterMvcRoutes(routes); //routes.Add(new WcmsHttpPostRoute("render", cmsRoutings)); //routes.Add(new CompiledArticleWrapperSampleRoute("samples/{id}", typeof(MvcApplication).Assembly, "DR.Event.Themes.Web.CompiledSamples", cmsRoutings)); //routes.Add(new RawXmlRoute("{*url}", webCmsUri)); //routes.Add(new GetDataProxyRoute("{*url}", webCmsUri)); //routes.Add(new PurgePartialWrapperProxyRoute("{*url}", webCmsUri)); //routes.Add(new PartialWrapperProxyRoute("{*url}", cmsRoutings, webCmsUri)); } } }