Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

LocalePrefix "never" + localeDetection "false" #745

Closed
DGTLDEVTEAM opened this issue Dec 22, 2023 · 1 comment
Closed

LocalePrefix "never" + localeDetection "false" #745

DGTLDEVTEAM opened this issue Dec 22, 2023 · 1 comment
Labels
enhancement New feature or request unconfirmed Needs triage.

Comments

@DGTLDEVTEAM
Copy link

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

@amannn
Copy link
Owner

amannn commented Dec 25, 2023

I'll move this to a discussion since it seems to be a usage question, I hope you understand.

Repository owner locked and limited conversation to collaborators Dec 25, 2023
@amannn amannn converted this issue into discussion #748 Dec 25, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants