1

My web application is based on .NET ASP MVC technology.

https://danswebsite.com/(D(anythingBlahBlahBlah))/en/Auths/AuthList

has the same result as

https://danswebsite.com/en/Auths/AuthList

which is the original URL.

I want to remove this automatic routing feature. I removed resolveUrl in the javascript files in my code base. But it still has this automatic routing feature as long as the first letter is from A to Z, in the example above, it is the letter D.

In global.asax.cs,

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
    routes.MapRoute("l10n", "{lang}/{controller}/{action}/{id}", 
                    new { lang = "en", controller = "Home", action = "Index", id = UrlParameter.Optional });
    routes.MapRoute("err", "{controller}/{action}/{exception}", 
                    new { controller = "Errors", action = "ApplicationError" });

    routes.MapRoute(
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = UrlParameter.Optional },
        new string[] { "DansWebSite.Mvc.Controllers" } 
    );
}

Could you help me to solve this problem?

Thank you in advance!

Dan

Stefan
  • 17,448
  • 11
  • 60
  • 79
Dan
  • 31
  • 2

0 Answers0