In ASP.NET MVC route configuration is like below:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
I am using [Route] attribute in Controller:
[Route("login")]
public ActionResult Login()
{
return View();
}
I can go to the page using both /login and Auth/Login. The second link is clearly from the default route, but I don't want that URL to go to my login page.
How can I do that?