Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7839083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:19:14+00:00 2026-06-02T15:19:14+00:00

I have website that shows user submitted content in 30+ languages in front page,I

  • 0

I have website that shows user submitted content in 30+ languages in front page,I am currently using paths like:

http://www.example.com?lang=en 

or if it’s not first page

 http://www.example.com?lang=en&page=2

But that really isn’t user or seo friendly.
Is there a way in mvc to route these values to something like

 http://www.example.com/en 

and

 http://www.example.com/en/2

without adding new action in-between like in this case lang:

http://www.example.com/lang/en/2

Update. Here is what I came up from Alexeis answer, in case anybody will need same thing:

In case of just language:

 routes.MapRoute("MyLang", "{lang}", new { controller = "Home", action = "Index" },new { lang = @"\D{2}"});

In case you need language and optionally page:

   routes.MapRoute("MyLang", "{lang}/{page}", new { controller = "Home", action = "Index", page = UrlParameter.Optional }, new { lang = @"\D{2}", page = @"\d+"});

It should not catch any other paths unless you have Actions with only 2 letters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:19:17+00:00Added an answer on June 2, 2026 at 3:19 pm

    You don’t need “lang/” for the route to match culture. Simple “{lang}” will do as long as you order routes in a way so other routes are matched correctly. You may also consider constraints on routing parameters to limit number of conflicts.

    routes.MapRoute("MyLang", "{lang}",
         new { controller = "Home", action = "Home",  }
    
    class HomeController{
      public ActionResult Home(string lang)
      {
        return View();
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website that's using forms authentication and membership. A user must have
I have a website that shows galleries. Users can upload their own content from
I have a page that the user can modify. All modifications are performed using
Say I have a website which shows the user ten images and asks them
I'm writing a report that shows total downtime for our website. When a user
I have a website that captures picture tags based on where the user clicked
Right now on my website I have the following JavaScript that shows and hides
I have a handler that shows user a message (this is called by jquery
We have a website that currently serves drawings to users via the SVG Viewer
I have a pretty basic page that shows every five minutes of the day

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.