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

redirects i18n locale:false not working as expected #19302

Closed
dohomi opened this issue Nov 19, 2020 · 2 comments · Fixed by #19766
Closed

redirects i18n locale:false not working as expected #19302

dohomi opened this issue Nov 19, 2020 · 2 comments · Fixed by #19766
Assignees
Milestone

Comments

@dohomi
Copy link

dohomi commented Nov 19, 2020

Bug report

Describe the bug

Redirects i18n feature with setting locale: false not working as expected.

To Reproduce

// one singular api catchall endpoint: [[...index]].tsx

 i18n: {
    defaultLocale: 'en',
    locales: ['en', 'de', 'it', 'es']
  },

async redirects(){
  return [{
    source: '/fussballtraining/fussballuebung-torschuss',
    destination: '/de/fussballtraining/fussballuebung-torschuss',
    locale: false,
    permanent: true
 }]
}

Expected behavior

I expect that any request of /fussballtraining/fussballuebung-torschuss will be redirect to /de/fussballtraining/fussballuebung-torschuss.

Current behaviour

The redirect is falsely redirecting to: /en/de/fussballtraining/fussballuebung-torschuss which results to a 500 / 404 error.

System information

  • Version of Next.js: 10.0.2
  • Version of Node.js: 12.0.x
  • Deployment: all platforms

Background

There are pages in the Google index without the locale identifier. I want all this pages redirected to the /{locale}/ counterpart.

@dohomi dohomi added the bug Issue was opened via the bug report template. label Nov 19, 2020
@ijjk ijjk added kind: bug and removed bug Issue was opened via the bug report template. labels Nov 19, 2020
@ijjk ijjk self-assigned this Nov 19, 2020
@domtaylor
Copy link

Experiencing the same issue

@kodiakhq kodiakhq bot closed this as completed in #19766 Dec 4, 2020
kodiakhq bot pushed a commit that referenced this issue Dec 4, 2020
This ensures i81n custom routes are resolving correctly, it also corrects redirects for default locales when `locale: false` is not used, and this also simplifies the resolving for custom routes with i18n in `next-server` adding types for the i18n config. This also adds additional tests to prevent regression and starts leveraging a shared `NextConfig` type to allow us to share types for config values. 

Fixes: #19521
Fixes: #19403
Fixes: #19302
Fixes: #19227
@Timer Timer added this to the iteration 14 milestone Dec 4, 2020
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants