LocalePrefix "never" + localeDetection "false" #748
Unanswered
DGTLDEVTEAM
asked this question in
Q&A
Replies: 1 comment
-
I'll move this to a discussion since it seems to be a usage question, I hope you understand. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
I am currently using Next.js version 14.0.3 in an app directory setup, and I'm facing a specific situation that requires attention. My company has mandated the use of localePrefix as "never" to ensure there are no locale routes visible in the URL. Additionally, we need to disable localeDetection for SEO purposes.
The rationale behind disabling locale detection is related to SEO optimization. Google servers tend to index websites based on the language, and with locale detection, the website opens with the matching language. This can lead to Google indexing only one language and not recognizing the alternatives.
The usage of canonical URLs and alternates helps with indexing, but there are inconsistencies in title, description, and images when switching between languages.
Open Graph images consistently display the English version (title, description, image) regardless of the URL language.
Closing language detection breaks language switcher functionality, making other language URLs inaccessible.
Describe the solution you'd like
I am seeking guidance or solutions to address these challenges while adhering to the company's requirements for localePrefix and the necessity to disable localeDetection. The goal is to ensure accurate indexing by search engines and present consistent language-specific metadata, including Open Graph images.
Any insights or recommendations on configuring Next.js 14.0.3 in this specific scenario would be greatly appreciated.
Describe alternatives you've considered
Perhaps an illustration of how to implement the solution using custom middleware in Next.js
Beta Was this translation helpful? Give feedback.
All reactions