How to do it...

  1. First, we have to install the UrlRewriting module using Web Plateform Installer:
  1. Next, we add a rule to redirect a legacy URL such as http://localhost:1962/products.ASPX?lang=fr-FR&category=smartphone&subcategory=samsung&id=cadc5808-75a7-4428-b491-3cacfe37d9ce to this existing MUV route: http://localhost:1962/fr-FR/products/smartphone/samsung/cadc5808-75a7-4428-b491-3cacfe37d9ce.

The MVC route has the following template pattern: http://localhost:1962/products/{lang}/{category}/{subcategory}/{id}.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.