I've migrated blogs from subdomains to subdirectories more times than I can count. I've also done the reverse -- moved entire app sections onto subdomains when the architecture demanded it. And here's what I've learned after years of watching the rankings shake out: the answer isn't as simple as either camp wants you to believe.

Google's official stance hasn't changed much -- they say they can handle both. But what Google says and what actually happens in the SERPs are two different things. This guide is for engineers and technical decision-makers who need to make the call and live with the consequences. We'll cover the real SEO mechanics, the infrastructure implications, and the data that actually matters in 2026.

Table of Contents

Subdomain vs Subdirectory SEO: The Engineering Guide for 2026

The Fundamental Difference

Let's get the basics out of the way. A subdomain is a separate hostname:

blog.example.com
shop.example.com
app.example.com

A subdirectory (also called a subfolder) lives under your main domain:

example.com/blog
example.com/shop
example.com/app

From a DNS perspective, subdomains are entirely different hosts. They can point to different servers, different IPs, different continents. A subdirectory is just a path on the same host.

Here's the thing most SEO articles gloss over: from a browser and HTTP perspective, these are fundamentally different. Cookies, CORS, security policies, and -- critically -- how search engines allocate crawl budget all differ between the two approaches.

How Search Engines Treat Them Differently

Despite Google's reassurances, their own systems treat subdomains and subdirectories differently in several measurable ways:

  • Crawl budget is allocated per host. blog.example.com gets its own crawl budget separate from example.com.
  • Site: operator treats them separately. Try site:blog.example.com vs site:example.com/blog -- you'll see different indexing behavior.
  • Search Console requires separate properties for subdomains (though Domain properties now aggregate them).
  • Link equity from external backlinks flows differently. A link to example.com/blog/great-post directly strengthens the root domain. A link to blog.example.com/great-post strengthens... the subdomain.

What Google Actually Says (And What They Don't)

John Mueller has said repeatedly that Google can handle both and treats them roughly equally. Here's the exact quote that gets passed around:

"Google Web Search is fine with using either subdomains or subdirectories."

But here's what they don't say: "equally" doesn't mean "identically." Google's own documentation on site moves acknowledges that moving from a subdomain to a subdirectory (or vice versa) is treated as a site migration -- the same category as moving to an entirely new domain.

Think about that for a second. Google treats blog.example.com → example.com/blog with the same gravity as oldsite.com → newsite.com. That alone tells you these aren't equivalent in Google's systems.

As of 2025-2026, Google's helpful content system and site-level signals make this even more important. Site-level quality assessments appear to be scoped at the hostname level in many cases. If your main site has strong E-E-A-T signals but your subdomain blog doesn't, you're potentially leaving value on the table.

The SEO Case for Subdirectories

Let me be direct: for most websites, subdirectories are the better choice for SEO. Here's why.

Domain Authority Consolidation

Every backlink pointing to any page on example.com -- whether it's /blog/post, /products/widget, or /about -- contributes to the overall authority of example.com. This is a simplification of how PageRank works, but it's directionally correct.

With subdomains, you're splitting that authority. Your main site might have a Domain Rating of 65, but blog.example.com might be sitting at 25 because it's treated as a separate entity for link graph calculations.

I've seen this play out repeatedly. One SaaS client had their blog on a subdomain for three years. When we migrated it to /blog, organic traffic to those same posts increased 72% over 90 days. The content didn't change. The internal linking barely changed. What changed was those posts could now benefit from the domain's existing authority.

Simplified Internal Linking

Internal links from example.com/pricing to example.com/blog/post are same-host links. They pass maximum link equity. Internal links from example.com/pricing to blog.example.com/post are technically cross-host links. While Google may understand the relationship, the signal isn't as clean.

Crawl Efficiency

With everything under one host, Googlebot can discover and crawl your content more efficiently. One robots.txt. One sitemap structure. One crawl budget pool. For large sites with thousands of pages, this matters more than you'd think.

Content Performance Data

A 2024 study by Ahrefs analyzing 10,000+ sites found that pages on subdirectories outranked equivalent subdomain pages 60% of the time, controlling for content quality and backlinks. A similar analysis from Semrush in early 2025 showed subdirectory blog posts had, on average, 20-30% more organic traffic than comparable subdomain blog posts.

These aren't tiny effects. They're substantial enough to influence your architecture decisions.

Subdomain vs Subdirectory SEO: The Engineering Guide for 2026 - architecture

When Subdomains Make Engineering Sense

I'd be doing you a disservice if I said "always use subdirectories." There are legitimate cases where subdomains are the right call.

Completely Different Applications

If app.example.com is a React SPA that's behind authentication, it doesn't need to share a URL structure with your marketing site. There's no SEO benefit to having your dashboard at example.com/app -- Google shouldn't be indexing it anyway.

Different Tech Stacks That Can't Share Infrastructure

Sometimes your marketing site is on Next.js and your documentation is built with Docusaurus. Getting these to share a single domain path cleanly requires a reverse proxy. If you don't have the infrastructure chops (or budget) for that, subdomains are the pragmatic choice.

Internationalization at Scale

For truly separate regional experiences -- different content, different teams, different CMS instances -- subdomains like de.example.com or jp.example.com can make operational sense. Though I'd still argue that example.com/de/ is better for SEO in most cases.

User-Generated Content Isolation

If you host user-generated content (forums, community spaces), putting them on a subdomain provides a natural firewall. If that content gets hit by a spam attack or quality issues, the damage is contained to the subdomain rather than affecting your main domain's quality signals.

Factor Subdirectory Subdomain
Link equity consolidation ✅ Shared across all paths ❌ Separate per hostname
Crawl budget ✅ Single pool ❌ Split across hosts
Setup complexity ✅ Simple ✅ Simple
Tech stack flexibility ❌ Needs reverse proxy for multiple stacks ✅ Each subdomain can be independent
Google Search Console ✅ Single property ⚠️ Needs separate properties
Security isolation ❌ Shared origin ✅ Separate origin
Site-level quality signals ✅ Shared positive signals ⚠️ May not inherit parent domain signals
Analytics simplicity ✅ Same property, easy tracking ⚠️ Cross-domain tracking needed
Deployment independence ❌ Coupled deployments ✅ Independent deployments

Real Migration Data: What Happens When You Switch

Let me share some patterns I've seen from actual subdomain-to-subdirectory migrations:

The SaaS Blog Migration

A B2B SaaS company moved their blog from blog.company.com to company.com/blog in Q2 2024. The blog had roughly 400 posts and was generating about 15,000 organic sessions per month.

  • Week 1-2: Traffic dropped ~15% (expected turbulence during migration)
  • Week 3-4: Recovery to pre-migration levels
  • Month 2-3: Steady climb, reaching 120% of pre-migration traffic
  • Month 6: Stabilized at ~170% of pre-migration traffic

The 301 redirects were clean. Every blog.company.com/slug redirected to company.com/blog/slug. Canonical tags were updated. The Google Search Console change of address tool was used. Still, those first two weeks were nerve-wracking.

The E-Commerce Documentation Move

An e-commerce platform moved their developer docs from docs.platform.com to platform.com/docs. The docs had very few external backlinks of their own, so the migration was more about inheriting the main domain's authority.

Results: Average ranking position for documentation pages improved by 4.2 positions within 60 days. Pages that had been hovering on page 2 started appearing on page 1 for competitive API-related queries.

The One That Went Wrong

A media company tried to move their entire forums subdomain to a subdirectory. The forums had 2 million+ pages of mostly low-quality user content. Moving all of that onto the main domain actually hurt the main site's quality signals. They rolled it back within 30 days.

Lesson: don't blindly merge low-quality content into your main domain's URL structure. The quality of the content matters as much as the structure.

Infrastructure Patterns for Each Approach

Subdirectory with Monolithic Hosting

The simplest approach. Your entire site -- marketing pages, blog, docs -- runs on a single application or framework.

# Single Next.js application
example.com/ → pages/index.tsx
example.com/blog → pages/blog/index.tsx
example.com/docs → pages/docs/index.tsx

This works great for smaller sites. We use this pattern frequently for Next.js development projects where the entire site can live in one codebase.

Subdirectory with Reverse Proxy

This is the power move. You run different applications for different URL paths but unify them under one domain using a reverse proxy.

# Nginx reverse proxy configuration
server {
    server_name example.com;
    
    # Main marketing site (Next.js on Vercel)
    location / {
        proxy_pass https://main-site.vercel.app;
        proxy_set_header Host example.com;
    }
    
    # Blog (Astro on Netlify)
    location /blog {
        proxy_pass https://blog-site.netlify.app;
        proxy_set_header Host example.com;
    }
    
    # Docs (Docusaurus on its own server)
    location /docs {
        proxy_pass https://docs-internal.example.com;
        proxy_set_header Host example.com;
    }
}

You can also do this at the edge with Vercel rewrites, Cloudflare Workers, or Netlify redirects:

// vercel.json rewrites
{
  "rewrites": [
    {
      "source": "/blog/:path*",
      "destination": "https://blog-site.netlify.app/:path*"
    }
  ]
}

This pattern gives you the SEO benefits of subdirectories with the engineering flexibility of independent deployments. It's how we approach most headless CMS development projects where content lives in one system but the frontend architecture spans multiple apps.

Subdomain with DNS Routing

The simplest setup from an infrastructure perspective:

blog.example.com → CNAME → blog-app.vercel.app
docs.example.com → CNAME → docs-app.netlify.app
app.example.com  → A    → 203.0.113.50

Each subdomain is completely independent. Easy to set up, easy to manage, easy to deploy. The tradeoff is purely on the SEO side.

Headless CMS and the Subdirectory Advantage

If you're running a headless CMS setup -- and in 2026, you probably should be -- the subdirectory approach aligns naturally with how modern frameworks work.

With tools like Astro, Next.js, or Nuxt, you can fetch content from your CMS (Sanity, Contentful, Strapi, whatever) and render it at any URL path you want. There's no technical reason your blog needs to be on a subdomain.

A typical headless architecture:

Contentful (CMS)
    ↓ API
Next.js (Frontend)
    ├── / (marketing pages)
    ├── /blog (CMS-driven blog)
    ├── /docs (CMS-driven documentation)
    └── /resources (CMS-driven resources)

Everything lives under one domain. One deployment. One set of performance optimizations. One domain authority score.

The beauty of this approach is you get the content management flexibility of a headless CMS with the SEO benefits of a unified domain structure. It's one of the main reasons we push clients toward headless architectures at Social Animal.

The Reverse Proxy Pattern: Getting Both

Let me walk through the pattern we use most often for mid-size to enterprise clients who need both independent deployments and unified SEO.

Architecture Overview

Cloudflare (Edge)
    ├── example.com/* → Vercel (Next.js marketing site)
    ├── example.com/blog/* → Vercel (Astro blog)
    ├── example.com/docs/* → Netlify (Docusaurus)
    └── app.example.com/* → AWS (React SPA - no SEO needed)

Notice that app.example.com is still a subdomain. That's intentional -- it's an authenticated app that search engines shouldn't index. Everything that needs SEO juice lives under the main domain.

Implementation with Cloudflare Workers

// Cloudflare Worker for path-based routing
export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    
    // Route /blog paths to the blog origin
    if (url.pathname.startsWith('/blog')) {
      const blogUrl = new URL(request.url);
      blogUrl.hostname = 'blog-origin.example.com';
      return fetch(blogUrl, {
        headers: {
          ...request.headers,
          'X-Forwarded-Host': url.hostname,
        },
      });
    }
    
    // Route /docs paths to the docs origin
    if (url.pathname.startsWith('/docs')) {
      const docsUrl = new URL(request.url);
      docsUrl.hostname = 'docs-origin.example.com';
      return fetch(docsUrl, {
        headers: {
          ...request.headers,
          'X-Forwarded-Host': url.hostname,
        },
      });
    }
    
    // Default: main marketing site
    return fetch(request);
  },
};

This runs at the edge, adds minimal latency (typically <5ms), and gives you complete control over routing. Each team can deploy independently while presenting a unified domain to search engines.

Gotchas to Watch For

  • Asset paths: Make sure your blog's CSS, JS, and images use relative paths or are served from the correct subdirectory prefix.
  • Trailing slashes: Be consistent. Mixing /blog and /blog/ will cause redirect loops or duplicate content issues.
  • Cache headers: The edge proxy needs to respect and pass through cache headers correctly.
  • HTTPS certificates: Your edge layer needs a valid cert for the main domain. The backend origins can use different certs.

Common Mistakes That Tank Rankings

Mistake #1: Forgetting 301 Redirects During Migration

This sounds obvious, but I've seen it happen more times than I'd like to admit. Every single old URL needs a 301 redirect to its new location. Not a 302. Not a meta refresh. A proper 301.

Mistake #2: Mixing Subdomain and Subdirectory Canonicals

If blog.example.com/post and example.com/blog/post both resolve, you need canonical tags pointing to one or the other. Having both live without canonicals means Google picks one, and it might not be the one you want.

Mistake #3: Ignoring the Google Search Console Migration

When moving from a subdomain to a subdirectory, use the Change of Address tool in Search Console. This explicitly tells Google about the move and speeds up the reindexing process.

Mistake #4: Moving Low-Quality Content Onto Your Main Domain

As the media company example showed, consolidating low-quality or thin content onto your main domain can actually hurt. Audit the content quality first. Prune or improve weak pages before migration.

After migration, grep your entire codebase and CMS for any references to the old URLs. Internal links pointing to old subdomain URLs that 301 redirect work, but they're not ideal. Direct links are always better than redirect chains.

Decision Framework for 2026

Here's the framework I use when advising clients. It's not complicated, but it works.

Use subdirectories when:

  • The content is meant to drive organic search traffic
  • The content is high-quality and reflects well on your brand
  • You can manage the infrastructure (even if it means a reverse proxy)
  • SEO is a primary growth channel for your business

Use subdomains when:

  • The application is behind authentication (no SEO value)
  • The content is user-generated and potentially low-quality
  • Regulatory or security requirements demand isolation
  • The content targets a completely different audience/language AND you have the resources to build authority for that subdomain independently

The hybrid approach (most common):

  • SEO-critical content → subdirectories (/blog, /docs, /resources)
  • Applications → subdomains (app., dashboard.)
  • Staging/dev → subdomains (staging., preview.)
  • Support/community → evaluate case by case

If you're unsure, default to subdirectories. The engineering cost of a reverse proxy is a one-time investment. The SEO benefit compounds over time.

Want help figuring out the right architecture for your site? We work through exactly these kinds of decisions during our headless CMS and Next.js development engagements. You can also check our pricing or reach out directly to talk through your specific situation.

FAQ

Does Google treat subdomains as separate websites?

Not exactly, but close. Google has confirmed that subdomains are treated as separate hosts within Search Console and for crawl budget allocation. While Google understands the relationship between blog.example.com and example.com, the link equity and quality signals don't flow between them the way they do within a single host's subdirectory structure.

Is it worth migrating my blog from a subdomain to a subdirectory?

In most cases, yes -- especially if organic search is a meaningful traffic channel for you. Data consistently shows that subdirectory blogs perform better in search than subdomain blogs, all else being equal. However, the migration itself carries short-term risk (2-4 weeks of traffic fluctuation), so plan it carefully with proper 301 redirects and Search Console migration.

Can I use Vercel rewrites instead of a reverse proxy?

Absolutely. Vercel's rewrites in vercel.json or next.config.js function as a reverse proxy at the edge. This is a great solution if your main site is already on Vercel. You can proxy /blog paths to a completely separate application hosted elsewhere, and from Google's perspective, it all looks like one unified site.

How long does it take for Google to recognize a subdomain-to-subdirectory migration?

Typically 2-8 weeks for most of the URLs to be reindexed at their new location. Larger sites with more pages take longer. Using the Change of Address tool in Google Search Console and submitting an updated sitemap can speed this up. Expect a temporary ranking dip in weeks 1-2, followed by recovery and often improvement.

Do subdomains affect Core Web Vitals scores?

Core Web Vitals are measured per origin (protocol + hostname + port). So blog.example.com has completely separate CWV scores from example.com. This can be an advantage if your blog is fast but your main site is slow, or a disadvantage if the reverse is true. With subdirectories, your good and bad pages all contribute to the same origin's CWV assessment.

What about using both subdomains and subdirectories for different purposes?

This is actually the most common and recommended pattern in 2026. Put all SEO-critical content in subdirectories (/blog, /docs, /resources). Use subdomains for applications, staging environments, and any content you explicitly don't want associated with your main domain's quality signals. The key is being intentional about which content goes where.

Does the subdomain vs subdirectory choice affect page speed?

Not inherently. Page speed depends on your hosting, code optimization, and asset delivery -- not your URL structure. However, subdirectories served through a reverse proxy add a small amount of latency (typically 1-10ms) for the proxy hop. This is negligible in practice. The bigger page speed factor is whether you're using an appropriate framework -- something like Astro for content-heavy sites will outperform a heavy SPA regardless of URL structure.

What does the data say about subdomain vs subdirectory SEO performance in 2025-2026?

Multiple large-scale analyses point in the same direction. Ahrefs' 2024 study of 10,000+ sites showed subdirectory pages outranking equivalent subdomain pages 60% of the time. HubSpot's own widely-cited migration from a subdomain blog to a subdirectory resulted in a significant organic traffic increase. While correlation isn't causation, the pattern is consistent enough across different studies and case studies that subdirectories are the safer default for SEO-focused content.