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

fix: Remove x-default alternate links entry for non-root pathnames when using localePrefix: 'always' #805

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Jan 22, 2024

Closes #799

Before:

link: <https://example.com/en/about>; rel="alternate"; hreflang="en",
      <https://example.com/de/about>; rel="alternate"; hreflang="de",
      <https://example.com/about>; rel="alternate"; hreflang="x-default"

After:

link: <https://example.com/en/about>; rel="alternate"; hreflang="en",
      <https://example.com/de/about>; rel="alternate"; hreflang="de"

Notes:

  • Only non-root pathnames are affected, the root (/) will still include the x-default entry.
  • The x-default entry is considered optional and we're still providing all links to localized pages, therefore this is fine from an SEO perspective.

Copy link

vercel bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2024 1:46pm
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2024 1:46pm

@amannn amannn changed the title fix: Remove x-default alternate links entry for `localePrefix: 'always' for non-root pathnames fix: Remove x-default alternate links entry for localePrefix: 'always' for non-root pathnames Jan 22, 2024
@amannn amannn marked this pull request as ready for review January 22, 2024 13:33
@amannn amannn merged commit c5bb0f5 into main Jan 23, 2024
7 checks passed
@amannn amannn deleted the fix/disable-x-default-non-root-locale-prefix-always branch January 23, 2024 11:30
@amannn amannn changed the title fix: Remove x-default alternate links entry for localePrefix: 'always' for non-root pathnames fix: Remove x-default alternate links entry for non-root pathnames when using localePrefix: 'always' Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant