-
Notifications
You must be signed in to change notification settings - Fork 30
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
Without Lang Prefix #20
Comments
We have same issue with unintended adding locale to url path. We use language subdomains so we end up with broken urls. |
Subdomains... I didn't thought about that... |
I gave it a try here, but there is still some issues to tackle. I tried to set localhost:3000 and localhost:3001 as different domains, then launch on instance on each port to test it locally, but even without next-translate-routes, it creates looping redirections. Do you have an idea why? domains: [
{
domain: 'localhost:3000',
defaultLocale: 'en-US',
http: true,
},
{
domain: 'localhost:3001',
defaultLocale: 'fr',
http: true,
},
], I leave it as is for now, since I need to work on other subjects. Feel free to give it a try too, you can reuse my PR. I will post here again when I will work on it again. |
I have created a fork to make this, I only had to change one line in fileUrlToUrl But It should change not depenging on the env variable but instead based on the next config domains array, still works for me, currently using it on a big site :) Where can I buy you a coffee ? Thanks |
Is it really enough?! 😮
😄 |
Yes, it works and its working in prod for a while now, I use this functions to sitemap, alternative lang links etc... I didn't made a PR since I only E2E test without unit test :P but it works ! If you want to see in prod the English version is gindumac.com |
Ok, cool. |
My site is multi-domain
( next config like: )
But my links now have are like : "dev.site.fr/fr-FR/example"
How to remove the language sufix since I already do it by domain ?
I managed to do like that
is this the proper way ? Can I remove all the language prefix everywhere ?
Also how to make the url "site.fr/sell" redirect to "site.fr/vendre" instead of redirecting with the lang prefix "site.fr/fr-FR/vendre/"
PS. THANKS FOR YOUR WORK ON THIS !
The text was updated successfully, but these errors were encountered: