I'm in the process of upgrading a v12 instance to 13. The Kentico admin side has all gone pretty smoothly (except for preview), but I'm running into issues with routing on the MVC instance.
We've been using DevTrev's DynamicRouting, and I've followed his instructions for migrating the URLs to the CMS_PageUrlPath table.
Note: I have NOT finished removing the addon from the admin, but considering the CMS_PageURLPath table is populated, I don't think that's necessary to make the routing work.
[assembly: RegisterPageRoute(CMS.DocumentEngine.Types.Lummus.HomePage.CLASS_NAME, typeof(HomeController), ActionName = "Index")]
My RouteConfig.RegisterRoutes method has the following:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // route for sitemap routes.MapRoute( name: "Sitemap", url: "sitemap.xml", defaults: new { controller = "Sitemap", action = "Index" } ); // route for robots routes.MapRoute( name: "Robots", url: "robots.txt", defaults: new { controller = "Robots", action = "Index" } ); // route for manifest.json routes.MapRoute( name: "Manifest", url: "manifest.json", defaults: new { controller = "Manifest", action = "Index" } ); // Map routes to Kentico HTTP handlers routes.Kentico().MapRoutes();
The sitemap.xml and robots.txt routes are working
The root URL returns a 403.14 error about not listing the directory contents, and any URLs of actual pages, including /Home, return a 404 from the StaticFile handler, so the appropriate routes or controllers are not picking up the requests.
Module IIS Web Core Notification MapRequestHandler Handler StaticFile Error Code 0x80070002
Have you added the 'UsePageRouting' in your 'Application_Start' or 'Startup.cs'?
I'm only finding that in the .Net Core docs, not the .Net Framework routing docs.
The IApplicationBuilder instance in ApplicationConfig.RegisterFeatures() doesn't appear to have that method.
Am I missing it?
Nevermind, I found it here. And the issue was that I needed to import the Kentico.Content.Web.Mvc.Routing namespace for the UsePageRouting extention method on the builder instance.
Thanks very much for pointing me in the right direction!
Please, sign in to be able to submit a new answer.