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

Implement Domain based locale detection #1283

Closed
cmaerz opened this issue Jun 23, 2021 · 2 comments
Closed

Implement Domain based locale detection #1283

cmaerz opened this issue Jun 23, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@cmaerz
Copy link
Contributor

cmaerz commented Jun 23, 2021

Is your feature request related to a problem? Please describe.
As mentioned in #1127 domain based locales are missing as a supported feature. In my current project I need the functionality. https://nextjs.org/docs/advanced-features/i18n-routing#domain-routing

Describe the solution you'd like
As my research shows the real hostname is forwarded till the _app.js file, but the domains confgured in next.config.js are not matched properly. I'm not really sure why it's not working.
Does anyone have hints for me? I would try to solve it myself, but I have no idea where to start.

image

@dphang
Copy link
Collaborator

dphang commented Jun 23, 2021

Yes sorry, this one is not implemented yet. If there is interest I can do it.

I think we will have to update the router around here to add the correct locale based on domain:

const uri = normalise(req.uri, routesManifest);
(similar to how we check hostname in the domain redirect).

@dphang dphang added the enhancement New feature or request label Jun 23, 2021
cmaerz added a commit to cmaerz/serverless-next.js that referenced this issue Jun 25, 2021
cmaerz added a commit to cmaerz/serverless-next.js that referenced this issue Jun 25, 2021
@dphang
Copy link
Collaborator

dphang commented Jul 5, 2021

This was added in the latest alpha versions, I think it should be working now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants