Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
ASP.NET Core MVC 2.0 Cookbook

You're reading from   ASP.NET Core MVC 2.0 Cookbook Effective ways to build modern, interactive web applications with ASP.NET Core MVC 2.0

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher
ISBN-13 9781785886751
Length 668 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Jason De Oliveira Jason De Oliveira
Author Profile Icon Jason De Oliveira
Jason De Oliveira
 Polat Polat
Author Profile Icon Polat
Polat
 Belkheraz Belkheraz
Author Profile Icon Belkheraz
Belkheraz
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Cross-Platform with .NET Core FREE CHAPTER 2. Visual Studio 2017, C# 6, IDEs, and Roslyn 3. Working with npm, Frontend Package Managers, and Task Runners 4. Reusing Code with NuGet 5. SOLID Principles, Inversion of Control, and Dependency Injection 6. Data Access - EF7 with Repository, SQL Server, and Stored Procedures 7. Accessing data with Micro ORMs, NoSQL, and Azure 8. Cache and Session - Distributed, Server, and Client 9. Routing 10. ASP.NET Core MVC 11. Web API 12. Filters 13. Views, Models, and ViewModels 14. Razor and Views 15. TagHelpers and ViewComponents 16. OWIN and Middleware 17. Security 18. Frontend Development 19. Deployment and Hosting 1. Other Books You May Enjoy Index

Creating SEO-friendly routes


In this recipe, we will learn how to create SEO-friendly routes. To do this, we can use the MVC routing system, the IIS UrlRewriting module, or both.

Getting ready

There are some scenarios where thinking about SEO is mandatory.

We are creating a new version of our website with MVC. But we have a lot of legacy URLs that are already used, or were recorded before the MVC version of our application. We also spent a lot of money for buying keyword to motorsearch as Google to throw all these URLs.

To manage this problem, we will use the IIS UrlRewriting module to redirect the legacy URLs to corresponding controller as an action.

How to do it...

  1. First, we have to install the UrlRewriting module using Web PlateformInstaller:
  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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images