For SEO reason I need my site to always use language code in the URL. At the moment mysite.com/en/news is also accessible through mysite.com/news, according to my SEO contact, mysite.com/news should return content.

How do I achieve this behavior?

  • check this answer drupal.stackexchange.com/questions/19078/… – Bala Sep 9 '13 at 13:36
  • Thanks but that question is about "all the URL without language prefix show the Japanese pages". I do not want to use URLs with no language code. I always want to use language code. Therefor I having a hard time using the answer for my question. – dbd Sep 9 '13 at 13:50

Using the Global Redirect module with the default options. You can redirects all URLs without a language prefix to the correct URL with the default language prefix contained.

| improve this answer | |

This is what you have (for example):

  • mysite.com (default)
  • mysite.com/fr (French)

This is what you are looking for (for example):

  • mysite.com/en (default)
  • mysite.com/fr (French)

This can be accomplished in your language settings. For each language you can set a Path prefix, use en and fr (for my example).

To redirect mysite.com to mysite.com/en you can use the Global Redirect module

| improve this answer | |

In Drupal 8 you can go to Manage > Configuration > Regional and language > Languages > Detection and selection > URL (configure). Here you can add a prefix for the URLs for every language.

| improve this answer | |

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.