New here? Visit our beginner's guide to SEO.
subdomain vs subfolder

Subdomain vs. Subfolder, Is One Better Than the Other for SEO?

Patrick Stox
Patrick Stox is Product Advisor, Technical SEO and Brand Ambassador at Ahrefs. He’s an organizer for the Raleigh SEO Meetup, Raleigh SEO Conference, Beer & SEO Meetup, Findability Conference, and moderator on /r/TechSEO.
Article stats
  • Monthly traffic 54
  • Linking websites 60
  • Tweets 65
Data from Content Explorer

Shows how many different websites are linking to this piece of content. As a general rule, the more websites link to you, the higher you rank in Google.

Shows estimated monthly search traffic to this article according to Ahrefs data. The actual search traffic (as reported in Google Analytics) is usually 3-5 times bigger.

The number of times this article was shared on Twitter.

    A Subdomain is on the left of the root domain (subdomain.domain.com), while a subfolder is on the right of the root domain (domain.com/subfolder).

    Let’s look at why SEOs argue over this topic and how it really works.

    1. Which is best for SEO?
    2. SEO case studies
    3. Reasons for traffic differences

    SEOs have argued about this for as long as I can remember. Many SEOs say that subfolders are better for SEO and insist on using them. This is a myth that’s persisted based on some old studies.

    Google has repeatedly said either is fine.

    Matt Cutts said in 2012:

    They’re roughly equivalent. I would basically go with whichever one is easier for you in terms of configuration, your CMSs, all that sort of stuff… Both are on the same domain overall and so it’s really a question of which one is easier for you. Whichever one makes you happier I’d go ahead and do it that way.

    Matt Cutts
    Matt Cutts, Former Head of Webspam Google

    John Mueller said in 2017:

    Google websearch is fine with using either subdomains or subdirectories. Making changes to a site’s URL structure tends to take a bit of time to settle down in search so I recommend picking a setup that you can keep for longer.

    John Mueller
    John Mueller, Search Advocate Google

    I don’t think they could make it any clearer, but some SEOs still argue with Google. I love John’s sarcastic response to these arguments.

    It’s silly to argue if a path is better on the left or the right. Without going into too much technical detail, these paths are virtual in most modern systems, which means they don’t even point to actual locations on a server. You can change their name and their location in the URL structure in a matter of minutes.

    Think about that for a second; you can change a subdomain to be served as a subfolder quickly and without changing anything else, so why do people think it’s important where the path is located in the URL?

    Many SEOs believe that subdomains are treated as separate domains, but the truth is more complicated. Anyone that incorporates subdomains as a main part of their site will likely have them treated the exact same as a subfolder would be treated. However, if you’re not treating the subdomains as part of your main website (read as not connecting them with internal links), then they may be treated as separate.

    A little history lesson. At one time, subdomains could get you additional listings in the SERPs. As with many things, SEOs abused this. Google closed this loophole in one of the old domain/host clustering updates.

    These days, subdomains are likely to be treated as part of the same website if they appear to be part of the same website. Even sitelinks include links to subdomains.

    Various Disney subdomains that have shown as sitelinks. Data from Ahrefs’ Site Explorer.

    I can give you countless examples where various subdomains show as sitelinks for the brand—Github, LinkedIn, Google, Amazon, Microsoft, Yahoo, Netflix, Walmart, etc.

    Many case studies show subfolders are better than subdomains, but I haven’t seen one that wasn’t complicated by other changes like additional internal linking or migrating multiple properties into one.

    Let’s look at one of those case studies and what I see. Using Top Pages 2.0 in Site Explorer, you can click and drag on the history chart to see the difference between any two dates. In the case of mention.com, they migrated from a subdomain to a subdirectory in January 2016. I really don’t see any difference in that period. It’s only after that when they started adding additional content that I see their traffic growing.

    And notice that an equivalent page for each page that lost traffic re-gained around the same amount of traffic. The traffic simply shifted to a new location, but there was no real increase.

    Here’s another fun one. Github migrated from a subfolder (github.com/blog) to a subdomain (blog.github.com) and then to a completely different domain (github.blog). There was some flux during the migration periods, and there were other changes during the transition, but it would be hard to argue that any one of these was better than the others simply because of the URL.

    Several different issues may cause people to believe that migrations had more or less impact than they really did.

    Temporary signal changes

    When pages are new or moved, Google may have them inherit some temporary signals at a folder or site level because they’re not quite sure how much to crawl or how to rank them yet. This can cause some temporary fluctuations while they figure out the changes.

    Tracking or measuring issues

    This can show up in many different forms. It might be analytics setup issues such as maybe subdomain tracking wasn’t set up correctly. It can be timing issues such as measuring growth during a fast season, such as holiday shopping vs. an average traffic period, or around a Google core update. It can only be looking at growth in the new folder. The main thing is to make sure that you’re comparing apples to apples.

    Blocked or noindexed pages

    If you block pages from being crawled or noindex pages, signals won’t consolidate correctly, which means you’re likely to see a drop during the migration. I’d recommend reading our robots.txt guide to understand this better.

    Redesign or platform change

    A lot of different things can change when you redesign a website or change the platform. Technology, speed, headings, URL changes, and more can all be different.

    Internal linking changes

    I see this one often in subdomain vs. subfolder case studies: Going from a separate subdomain that wasn’t linked internally to a subfolder that’s linked to on every page. Of course there’s going to be an uplift.

    Removed or updated content

    Changing content means ranking and traffic are likely to change. If you remove content that had traffic, then traffic drops.

    Final thoughts

    Changes introduce risk. You might want to think twice before changing from a subdomain to a subfolder if the only reason you’re doing it is for SEO.

    If you have a case where you migrated and saw an uplift without any of the changes above, I’d love to see it. Send me a message on Twitter, and I’ll investigate, but I’m willing to bet there is a change that can explain the difference.

    • Monthly traffic 54
    • Linking websites 60
    • Tweets 65
    Data from Content Explorer