4

I have a Drupal 8 site with two languages, Japanese (default language) and English.

By default, the default language pages are available at both / and /ja.

For example, /about and /ja/about both go to the Japanese "about" page.

I want to get Drupal to force the path prefix so that the URL is always shown as /ja/about and never just /about.

Interface text language detection settings

  • URL (path prefix, english: en, Japanese: ja)
  • Selected language (Japanese)

How can I do this?

For Drupal 7: see this question

  • The accepted answer of the linked question is still correct, only that Global Redirect is deprecated and you should use Redirect, see the module description. – 4k4 Nov 8 '17 at 14:10
4
  1. Select "English" as the default language and save
  2. Select "Japanese", again, as the default language and save

This way, you will force Drupal to prefix the URL's by the language id, even for the default language.

4

Here the steps:

  1. Install Redirect module.
  2. Enable the module /admin/modules
  3. Go to admin page /admin/config/search/redirect/settings.
  4. Ensure Enforce clean and canonical URLs is checked.
  • This did the trick. Thanks Patrick Kenny. – ARUN May 9 at 14:27
0

Prefix - suffix configuration is moved to the URL language detections settings at Drupal 8 Please, use this path to edit suffixes for each language:

admin/config/regional/language/detection/url 

And dont forget to move up URL detection rule

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.