1

I'm posting this on behalf of a client and am unfamiliar with Kentico and .NET so please bear with me.

The issue

Our client has a website in two languages, let's say English and German.

URLs are currently outputting like this:

  • example.com
  • example.com/home (when they try to redirect this to the root, they get a loop)
  • example.com?lang=de
  • example.com/home?lang=de
  • example.com/cat-l1/page
  • example.com/cat-l2/page?lang=de

Even with canonicalization, the above is very untidy and bad for SEO purposes.

My client has tried to implement multilingual prefixes for URLs in Kentico 8, but wound up with something like:

  • example.com/en
  • example.com/de
  • example.com/en/page
  • example.com/de/seite

This is better, but I neither want to redirect the root domain nor have the superfluous /en/ subdirectory.

I've gone through Kentico support forums and tried to source documentation, but this information doesn't appear to be readily available.

What I require

I would like to use multilingual prefixes ONLY for alternate languages (not the default). For instance:

  • example.com/
  • example.com/de
  • example.com/page
  • example.com/de/seite

Can someone please let me know:

  1. What CMS settings need to be set in order to get the required URL structure to work?
  2. If some kind of custom URL rewriting handler is required, what needs to be done? (I'll update this as I go, but don't even know where to look/start)
1

1 Answer 1

1

If understand correctly you want default (English) with no prefix, and other langs with prefix. You can do it purely with Kenitco settings (I had the same set up on one of my web sites). Go to settings-> URLs and SEO -> SEO - Cultures. You need to check the last 2 (Use language prefix for URLs and Allow URLs without language prefixes). Here is the documentation Also take a look at how to configure prefixes

Also make sure that in sites -> your site name -> culture Default content culture is set to English. I know you can do with routes, i.e. you will have /home for english and /de/home for German, but I don't think you can do it with standard URLs. Essentially you will have to switch to routes the whole site (if your site is not big you can do it manually).

P.S. When you adding a new route you need to restart the app in order for route to work (especially in 8).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.