Skip to content

Option to prefer the prefixed path with prefix_and_default strategy #3914

@hermes85pl

Description

@hermes85pl

Describe the feature

I can see that despite having a few configuration options, the module is opinionated in terms of path preference. In case of the prefix_and_default strategy, it consistently prefers a path with no prefix. I don't think this should be the case: the module users should have an option to change this, depending on what drew them to thinking about using this strategy.

I would like to have an option to set the opposite preference, so that specifically:

  • When setLocale is called, the user is redirected to /en/foo rather than /foo.
  • Each corresponding link of rel="alternate" (for the language), as well as that of rel="canonical", points to /en/foo.
  • The default link of rel="alternate" (hreflang="x-default") points to /foo.

IMHO this behavior would even make for a nice default for this strategy and it would play nice with SEO if one ever chose to switch between prefix_and_default and prefix (with redirectOn: 'no prefix') at some point, while these two strategies are the best ones for SEO and caching.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions