Closed alivarastepour closed 1 month ago
Hi @alivarastepour, I am not sure if one is better than the other. I assume as long as your slugs are properly translated it does not matter if you choose subdomains (fr.example.com) or subdirectories (example.com/fr). It depends on your needs.
From dev perspective IMO subdirectories are a bit straightforward to translate. One file = one translated route.
Using subdomain needs some complex routing/rewriting to have urls properly translated and routed.
Hi @alivarastepour, I am not sure if one is better than the other. I assume as long as your slugs are properly translated it does not matter if you choose subdomains (fr.example.com) or subdirectories (example.com/fr). It depends on your needs.
From dev perspective IMO subdirectories are a bit straightforward to translate. One file = one translated route.
Using subdomain needs some complex routing/rewriting to have urls properly translated and routed.
Hello @svobik7 , thanks for your opinion; I'll let this stay open in case anyone had anything to say.
No drawbacks with a generic TLD (.com etc), see Googles own recommendations: https://developers.google.com/search/docs/crawling-indexing/url-structure
With generic domain (.com, .org, .net etc) , the structure next-roots provides fits into a recommended URL strategy.
If you have ccTLD like .se, .dk, .no etc, I don't think it is recommended to have something like https://example.de/en, as the domain name itself and the first subdir is contradictory. Of course, in some situations it just can't be helped (if you already own example.dk and have traffic and business with it, and at the same time example.com is already owned by someone else). I don't think it's disastrous to do it like that, as I've seen many high profile sites with ccTLD's use subdirs for /en etc.
In that case, there are other bigger issues as well, for example it's not possible to share cookies between domains. If your content and site is good overall, I hardly think google would punish your ranking for using blah.de/en anyway.
I noticed when I added next-roots and started utilizing it my TBT on lighthouse skyrocketed. Script Evaluation went through the roof and messed up my Lighthouse scores. Not sure if it's next-roots but highly suspicious of it. The day we merged that PR (and only that PR) is when our lighthouse scores were affected. Maybe it has something to do with the Router.setPageHref function being on every page?
I noticed when I added next-roots and started utilizing it my TBT on lighthouse skyrocketed...
Hmm, it should not affect TBT imo. Would it be possible to create minimal reproducible repo with your code so that we can investigate?
@svobik7 Hi, I apologize, after looking deeper I found something else to be the root cause. That localization PR had something else that caused the issue. I'm sorry!
Np, glad you solve it 👍
I was wondering what are the possible drawbacks or advantages of this method for handling i18n regarding SEO, compared to other ways e.g. using subdomains(www.fr.somesite.org/about)