Error in sitecore mvc routing: An illegal route has been detected: '{controller}/{action}/{id}'.

- Pranay on Apr 22 '15 at 15:40
- viewed 3271 times

I have installed sitecore 7.5 and configured it with visual studio, but when I launch the website in browser, I get the below exception. The sitecore website was running fine before the visual studio integration. Only after the integration I am facing this problem.

The following fatal error have been detected:
1: An illegal route has been detected: '{controller}/{action}/{id}'. If you wish to
keep this route, please remove it from the Mvc.IllegalRoutes setting. 

Any help is much appreciated. Thanks!

  •     •    
  • Apr 22 '15 16:57

Issue resolved after removing the below lines from RouteConfig.cs file.

    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "home", action = "index", id = UrlParameter.Optional }

This is the MVC route that comes by default in an mvc application. Because of this, the website is applying the defeault MVC routing pattern. Normally in sitecore, the URL is mapped to content items instead of MVC routes. Go through this link for more information.

Your Comments

You might also like

1. In Sitecore MVC, why is Razor actionlink is displaying the url as api/sitecore/Controller/action?

2. What is keystone and how it is used with sitecore?

3. Automation tools for Windows Mobile App

4. Responsive design in sitecore mvc using bootstrap

5. Html5 picture tag example and browser support