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

Pranay    22 Apr '15    4217 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.

routes.MapRoute(
    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 asp.net 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






You might also like

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

2. Responsive design in sitecore mvc using bootstrap

3. When and how to use Script Task in SSIS

4. To get country/geo location of a user using C# MVC, client IP

5. Count number of visitors of a page in asp.net mvc (HIT counter)


Want more such posts, subscribe here

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.