Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hreflang and other seo tags do not take into account multiDomainLocales #3374

Open
jorismak opened this issue Feb 25, 2025 · 0 comments
Open

Comments

@jorismak
Copy link

Environment

Reproduction

I've tried a little reproduction, but it can't show the problem, since it's multi-domain related.

https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-mskkov9l?file=pages%2Findex.vue

Describe the bug

I've configured a few locales (en, nl, ja) en enabled some of those locales on some domains.
The nl.localhost domain has nl + en, the ja.localhost domain has ja + en, and the en.localhost domain has en.

If I now visit ja.localhost, I expected the hreflang attributes (And other seo tags) to only references the locales I've enabled for that domain.

Instead, I get all the locales, so that creates invalid hreflang tags like 'nl.localhost/ja', causing server errors during SEO crawling.

Maybe related, but availableLocales from useI18n() also reports all the locales instead of the ones from the custom domain.

Additional context

Together with the existing issue that hreflang tags get added automatically by setI18nParams() (so even when not calling useLocaleHead()), they get added on every page, and contain invalid links and I can't turn them off (Without ugly hacks using useActiveHead()).

Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant