Home > Blog > 2016 > 11 > Adding the Language to the URL

Adding The Language to the URL

If you're doing a one to one translated language site, you'll want to be able to switch the language. You could do this by setting a cookie and reloading the page, but that's crap for SEO, and means users can't share links to the pages in the different languages.

Conventional wisdom states that you should include the language in the URL in some fashion. One option is to include it in the querystring (don't laugh, I've seen this done in the wild). DON'T!!! You then have to remember to pass the variable around everywhere, and it's easy to forget, so the selected language randomly gets lost, and the user switches language without meaning to. You can also have different subdomains/domains for each language, but that's a bit faffy to set up and configure, especially if you're continually adding new languages.

Ideally, you want to make the language code part of the URL. I've seen site that add it to END of the URL, like "/my-page/de/", this is also not great. It makes the URLs harder to hack around. Take "/about-us/awards/" for example, if you knock off the awards part, you know you're getting the about us page. If you have the language at the end, if you don't leave the language on the end when you hack off the awards part, you get the about us page in English, not German.

For this reason, you should always include the language at the START of the URL, that way you can hack around to your heart's content, and the language will be kept!

If you're using Umbraco, you can do clever things with UrlProviders and Resolvers to automatically include the language in the URL without much extra work (I'll blog about this at a later date).

Enter Comment

2 comments for “Adding the Language to the URL”

  1. Posted 20 May 2025 at 08:48:49

    I’ve been looking around for baseball clubs near me and came across BaseballConnected. It’s way better than randomly Googling “baseball teams near me.” They list everything from youth baseball clubs near me to 16u travel baseball teams, and even details on travel baseball tryouts near me. Super useful if you're serious about getting your kid on the right team.

  2. Posted 23 May 2025 at 08:12:51

    If you're ever near Spring Hill and care about where your meat comes from, I highly recommend checking out Teague Premium Beef. I stumbled across them while searching for quality spring hill meats, and now it's the only beef I trust. Their blend of grain fed and grass fed beef truly sets a new standard in what you'd expect from Tennessee premium beef. It tastes cleaner, fresher, and more natural—just like meat from an honest farm in Spring Hill should.