Asp.net mvc routing with optional initial parameter

I am running a port on an existing ASP.NET Web Forms CMS for ASP.NET MVC and want to get routing from the start.

Note. It is not important to have exactly the same URL structure.

I think this answer is close to what I'm looking for, but I would like someone else to have some additional input.

The current URL structure is similar:

? Content = News / CurrentNews / This _is_a_news_article
? Content = Corporate / about_us / Overview

etc.

I would like to add an optional language parameter and keep a similar structure in MVC. So something like:

News / CurrentNews / This-this-news-article
en / News / CurrentNews / This-this-news-article

//CurrentNews/---
///CurrentNews/---

?

/CurrentNews/This---/
//CurrentNews/---/

, ( ) , .

, URL- , SEO . .. URL- .

URL- .

/---

> > >

? ?

+3
1

, . , , , , , en. , , , . , .

:

[language]/[category]/[subcategory]/[itemtitle]/[itemid]

[itemId] ? -, , 2 . " " , , . SEO-, , ( , ).

, [] , .

, blogpost , , , - MVC 3. !

+1

Source: https://habr.com/ru/post/1763245/


All Articles