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

By Pranay
24 May '20  ·  5532 views

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
Pranay Deegoju

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.

  • Jun 05 '18 10:25
Yojana Ambavkar

Remove Mvc.IllegalRoutes value from the file Sitecore.Mvc.Config file

Your Comments

Recent Posts


Liked this article?

Subscribe with your email and get updates when ever a new article is posted.

By subscribing you agree to our privacy terms. We promise that we do not sell your data.