Excluding the default language from the URL #70134
Unanswered
simon86pl
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I want to create a website with multiple language versions, with English as the default. Unfortunately, I have an issue. Even though the default version is set to 'en', you can still access it via '/en', but it should only be available under '/'. The other language versions should be accessible via '/de', etc. Currently, I have everything in /app/[locale]/page.tsx. Is there a way to configure this? The current solution makes no sense. I saw in the documentation that this was the default behavior on the Pages router. Unfortunately, it’s not the case in the App Router. I found a solution on YouTube, but it doesn’t fully work. I can access the English version without '/en', but I can still access the same pages with the '/en' prefix, which is unacceptable for SEO...
I've seen that similar topics have been raised, but the problem hasn't been resolved... I managed to create a working solution, but you need to have all files duplicated, for example, /app/page.tsx and /app/[locale]/page.tsx.
Beta Was this translation helpful? Give feedback.
All reactions