Repercussions of redirecting root domain to subdomains

So there's a few tradeoffs to using subdomains over subdirectories in regards to where to redirect.

SEO

First off, Google's official documentation claims that it treats subdomains and subfolders identically after a few days (it takes a few days for it to learn how to crawl your subdomains). However, it likely will take a little bit more setup to setup subdomains rather than subfolders. Ultimately, the biggest winner will be whichever is easiest for you to maintain and update as that will allow you to optimize SEO in other ways.

Security

The other consideration between subdomains and subfolders is security. Browsers treat subdomains as separate origins, meaning that the same origin policy will give us some added security benefits. Specifically, this means that content on one origin cannot read content on another origin by default, it must be explicitly granted that approval. So, if you're hosting multiple services across different origins and one of them has a web vulnerability in it, it will be significantly harder for an attacker to jump from that domain to another. Consequently, you can prioritize security efforts for the domains that contain the most sensitive data.

With subfolders, if one page has a web vulnerability, the attacker can easily pivot to attack other pages as well. In this model, the security of your site is as good as your weakest page, rather than each page (subdomain) having its own separate security model.

Conclusion of subdomain vs subfolder

Based on your example, it looks like these websites may have similar content but be localized a bit differently. If that's the case, and your sites are simple (serving static content or not having any particularly sensitive components) I'd recommend subfolders as it's likely easier to setup.

If you have complex components (or you might in the future) or each site is fairly different I'd recommend subdomains for the security gain. If you're unsure if you're going to have complex/sensitive components in the future I'd also recommend subdomains as it errs on the side of caution.

Conclusion of redirecting in general

The redirect in general should have no impact on SEO as Search Engines can use it to index your subdomains. I would however, include a link on the page which does the redirect, just to make it more explicit to Search Engines where the redirect is going to and to help them index.


Checkout this guide : https://edit.co.uk/blog/seo-javascript-redirects-evidence-pass-pagerank/

Doing redirects in JavaScript is definitely a "better than nothing" solution, rather than anything that should be recommended. It means placing your trust in something in that is supposed to work work, as opposed to something that definitely will.

I'd make sure there really was no way to do the redirects properly first, before falling back to the last-ditch solution.

Here's a test from a year ago that showed ranking authority was passing through JS redirects, but note all the caveats they include (especially that Bing didn't handle this at all at the time). https://www.branded3.com/blog/seo-javascript-redirects-evidence-pass-pagerank/


There's an article Neil Patel wrote on this subject that I read a few months ago. It is my understanding that subdirectories are better for SEO than subdomains in most cases. If that's a viable option, I would recommend it.

However Neil's article goes over SEO optomization techniques to use. Overall it shouldn't affect SEO much especially if subdirectories are an option.

Search Engine Results Favor Subdirectories over Subdomains Search Engine Results

Neil Patel Article: https://neilpatel.com/blog/international-seo