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?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
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.
This is what you have (for example):
This is what you are looking for (for example):
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
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.