I have created one sample internet MVC application. Then created ProductsController with Index view.
Then in routing, I mapped product url with products/prodname/id with below routing rules.
routes.MapRoute(
name: "ProdDef",
url: "{controller}/{name}/{id}/{action}",
defaults: new { controller = "Products", action = "Index", id = UrlParameter.Optional, name = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
But after this, contact page redirects me to home index controller action. ?? why so? Am I missing something and why other actions stopped working after creating only one rule for product.