skip to Main Content

Let’s say we have a domain for example

www.example.com

And we have some subdomains for different countries

au.example.com
us.example.com
uk.example.com
eu.example.com

What are the disadvantages to this. I’m speaking from an SEO Google perspective and anything else you may think of?

The problem
We have a client side JS redirect that redirect users based on their country code. This is unavoidable currently as we have no control over our backend.

If we use our root domain for the sole purpose of redirecting (via HTACCESS for example) to subdomains (I’d host this elsewhere and change the A records to reflect that), what could be the drawback to the SEO etc.

3

Answers


  1. 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

    Login or Signup to reply.
  2. 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/

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search