Skip to content

Add query strategy #2051

@Ionys320

Description

@Ionys320

Clear and concise description of the problem

For the moment, in order to be SEO compliant, we need to use prefix strategies, making the URLs a bit long (https://mydomain.com/en/meowmeow). Even if there are strategies that can avoid /en/ if it's the default language, it will still be displayed for others locales.

Suggested solution

We could implement a query strategy. Using it, my previous URL would looks like https://mydomain.com/meowmeow?i18n=en, making it shorter. It could even write the language into the i18n cookie, and therefore avoid needing it after.

This mean it would be needed to add the strategy here, and to update the Nuxt modules to handle it correctly.

Alternative

I tried to add a middleware and the no_prefix strategy, but even if it can correctly detect the query parameter and save it for later, it's unfortunately not SEO compliant because useLocaleHead of the Nuxt module is not handling it as I would like (which is normal ofc).

Additional context

I wonder how much work it could take. Because I make this suggestion, I may handle it, but I guess adding strategies is a big stuff, so maybe I would need help.

Thanks for reading me!

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions