Subdomain vs Subdirectory for SEO: Which Structure Wins?
Should your blog live at blog.example.com or example.com/blog/? This decision affects domain authority, crawl budget, link equity, and ultimately your organic traffic. We break down the data, Google's official stance, real migration case studies, and give you a clear decision framework.

Web hosting enthusiast who tests providers and breaks down features, pricing, and real world speed

The Quick Answer
Subdirectories win for SEO in almost every scenario. They consolidate domain authority, share link equity across your entire site, simplify analytics, and avoid the risk of Google treating your content as a separate website. Use subdomains only when you have a strong technical reason (different platform, isolated application, or multi-tenant architecture).
✅ Subdirectory (Recommended)
example.com/blog/
Shares domain authority, consolidated backlinks, one Search Console property, simpler setup
⚠️ Subdomain (Situational)
blog.example.com
Separate authority, isolated backlink profile, separate Search Console, different server/platform
Subdomain vs Subdirectory Explained
| Attribute | Subdomain | Subdirectory (Subfolder) |
|---|---|---|
| URL structure | blog.example.com | example.com/blog/ |
| DNS record needed | Yes, CNAME or A record for the subdomain | No, same domain, just a path |
| Server configuration | Can point to a different server/IP entirely | Served from the same server & document root |
| SSL certificate | Needs coverage (wildcard or separate cert) | Covered by the root domain's certificate |
| Google Search Console | Separate property, must verify independently | Same property, no extra setup |
| Analytics tracking | Needs cross-domain config (GA4 data stream) | Automatic, single data stream |
| Domain authority | Builds independently (doesn't boost root domain directly) | Consolidated, all pages boost the same domain |
| Backlink equity | Siloed to the subdomain | Flows to the entire domain |
| Crawl budget | Separate crawl budget allocation | Shared crawl budget (usually beneficial) |
| Cookie sharing | Requires explicit domain=.example.com | Automatic, same origin |
| Platform flexibility | Can run WordPress, Node.js, Shopify independently | Must be served by the same web server/app |
How Google Treats Each Structure
Google's official position: "Google Search can handle subdomains and subdirectories equally well, in most cases.": John Mueller. However, "equally well" doesn't mean "equally beneficial for your rankings." Here's what the data shows:
Link equity distribution
🔹 Subdomain
Backlinks to blog.example.com do NOT directly boost example.com's authority in Google's link graph. They're counted as links to a related but separate entity.
🔸 Subdirectory
Backlinks to example.com/blog/post-title directly strengthen example.com's overall domain authority. Every guest post, mention, and share benefits your entire site.
Crawl budget allocation
🔹 Subdomain
Google assigns separate crawl budgets. If your subdomain has thin content or crawl issues, it won't penalize your main domain, but it also won't benefit from your main domain's crawl priority.
🔸 Subdirectory
Shared crawl budget means your high-authority root domain's crawl frequency benefits your blog/content pages. Google discovers and indexes new content faster.
Ranking signal consolidation
🔹 Subdomain
Topical authority, E-E-A-T signals, and trust metrics are partially siloed. Google has improved at associating subdomains with parent domains, but 'partially' isn't 'fully.'
🔸 Subdirectory
All ranking signals are consolidated under one domain. Your about page, contact info, privacy policy, and authority signals all contribute to every page's trustworthiness.
Keyword cannibalization risk
🔹 Subdomain
Lower risk, Google may not associate subdomain content with your main domain, so cannibalization is less likely (but so is the SEO benefit).
🔸 Subdirectory
Slightly higher cannibalization risk if you publish similar content on your blog and main pages. Solve with proper internal linking and canonical tags.
Real Case Studies & Data
| Company | Migration | Result | Timeline |
|---|---|---|---|
| HubSpot | blog.hubspot.com → hubspot.com/blog/ | +30% organic traffic within 6 months. Blog authority consolidated with main domain. | 6 months to full recovery + growth |
| Moz | Tested subdomain vs subdirectory for content sections | Subdirectory pages consistently ranked higher for competitive keywords. Published findings recommending subdirectories. | Multiple A/B tests over 2 years |
| Shopify | Partners blog from subdomain → subdirectory | +20% organic visibility for partner-related content. Better internal link flow to main Shopify pages. | 3–4 months to stabilize |
| Monster.com | career-advice.monster.com → monster.com/career-advice/ | +40% organic traffic to career advice content. Benefited from Monster's strong domain authority. | 4 months to full recovery |
| Yelp | Keeps subdomains for city pages (e.g., sf.yelp.com) | Works for Yelp's scale, but they have massive independent authority on each subdomain. Not replicable for most sites. | N/A, established architecture |
| WordPress.com | username.wordpress.com for hosted blogs | Each subdomain ranks independently. Bloggers eventually move to custom domains for better SEO control. | N/A, platform architecture |
Pattern: Companies that migrated from subdomains to subdirectories consistently saw organic traffic increases of 20–40% within 3–6 months. The few exceptions (Yelp, Google) have massive independent authority that most sites can't replicate.
When to Use Subdomains
Subdomains are the right choice in specific scenarios where technical isolation or platform separation outweighs the SEO consolidation benefits:
| Use Case | Why Subdomain Works | Example |
|---|---|---|
| Web application (SaaS product) | Different tech stack (React/Node) from marketing site (WordPress). Needs independent deployment, scaling, and monitoring. | app.example.com |
| Multi-tenant platforms | Each customer gets their own branded space. Dynamic subdomain creation via DNS wildcard. | customer1.example.com |
| Separate e-commerce platform | Shopify/BigCommerce can't serve from a subdirectory on your WordPress site without reverse proxy. | shop.example.com |
| API / developer docs | Different framework (Docusaurus, GitBook), separate CI/CD pipeline, different update cadence. | docs.example.com / api.example.com |
| Status / monitoring page | Third-party service (Statuspage, Betteruptime) requires subdomain pointing. | status.example.com |
| Staging / testing environments | Need isolated environments that don't affect production SEO. Should be noindexed. | staging.example.com |
| Completely different audience or language | Country-specific content with different SEO targets (debatable, subdirectories often still win). | de.example.com (vs example.com/de/) |
When to Use Subdirectories (Most Cases)
Blog / content marketing
example.com/blog/
Every backlink, social share, and ranking signal strengthens your main domain. This is the single biggest SEO win.
Resource center / guides
example.com/resources/
Long-form content builds topical authority for your entire domain, not just a siloed subdomain.
Knowledge base / help center
example.com/help/
Support content often ranks well for long-tail queries; that ranking power should benefit your main domain.
Case studies / portfolio
example.com/case-studies/
Social proof content that earns links should directly boost your homepage and service pages.
Landing pages / campaigns
example.com/campaign-name/
PPC and organic landing pages benefit from root domain authority and shared conversion tracking.
E-commerce (same platform)
example.com/shop/
Product pages benefit from blog authority, and blog benefits from product page backlinks. Compound effect.
Technical SEO Considerations
| Factor | Subdomain | Subdirectory | SEO Winner |
|---|---|---|---|
| XML Sitemap | Separate sitemap per subdomain | One sitemap (or sitemap index) for entire domain | Subdirectory, simpler management |
| robots.txt | Separate robots.txt per subdomain (blog.example.com/robots.txt) | One robots.txt for entire domain | Subdirectory, unified crawl directives |
| Internal linking | Links from main site to subdomain are treated as 'semi-external' | Standard internal links, full PageRank flow | Subdirectory, maximum link equity |
| hreflang tags | Must reference full subdomain URLs | Standard path-based references | Tie; both work equally |
| Canonical tags | Must use full subdomain URL in canonical | Simple path-based canonical | Tie; both work if implemented correctly |
| Core Web Vitals | Measured separately per origin (subdomain) | Measured for entire domain | Subdirectory, good CWV benefits all pages |
| Security headers (HSTS, CSP) | Must be configured per subdomain | One configuration covers everything | Subdirectory, less config surface |
| CORS configuration | Required for cross-subdomain API calls | Not needed, same origin | Subdirectory, no CORS overhead |
International SEO: Subdomains vs Subdirectories
For multilingual or multi-region sites, you have three options. Here's how they compare:
| Structure | Example | SEO Pros | SEO Cons | Best For |
|---|---|---|---|---|
| ccTLD (country domain) | example.de, example.fr | Strongest geo-targeting signal. Clear to users. | Separate domains, zero shared authority. Most expensive. Must build SEO from scratch per country. | Large enterprises with big budgets per market |
| Subdomain | de.example.com, fr.example.com | Easy server-level separation. Can host in local data centers. | Partially separate authority. More complex analytics. Separate Search Console properties. | Mid-size companies with regional teams |
| Subdirectory ✅ | example.com/de/, example.com/fr/ | Consolidated domain authority across all languages. One Search Console property. Simplest hreflang setup. | Server must handle all languages. Harder to geo-target without hreflang + GSC targeting. | Most businesses, best SEO ROI for internationalization |
Migration Guide: Subdomain → Subdirectory
| Phase | Step | Details |
|---|---|---|
| Pre-migration | Crawl and inventory all subdomain URLs | Use Screaming Frog or Sitebulb to export every URL, its status code, and metadata. This is your redirect map. |
| Pre-migration | Document current rankings and traffic baseline | Export Google Search Console data (clicks, impressions, positions) for the subdomain. Take GA4 snapshots. |
| Pre-migration | Plan URL mapping: old → new | blog.example.com/post-title → example.com/blog/post-title. Keep URL slugs identical when possible. |
| Setup | Configure web server to serve content from subdirectory | Nginx: location /blog/ { ... } or reverse proxy. Apache: Alias /blog/ /var/www/blog/ or mod_proxy. |
| Setup | Implement 301 redirects for every URL | In the subdomain's server config or .htaccess: Redirect 301 /post-title https://example.com/blog/post-title |
| Setup | Update all internal links site-wide | Search and replace all references from blog.example.com to example.com/blog/ in templates, content, and navigation. |
| Launch | Deploy changes and verify 301s are working | Spot-check 20+ redirects manually. Use httpstatus.io or curl -I to verify 301 status codes. |
| Launch | Submit updated sitemap to Google Search Console | Remove old subdomain sitemap. Submit new sitemap with example.com/blog/ URLs. |
| Launch | Request re-crawl of key pages via URL Inspection tool | Submit your 10–20 highest-traffic URLs for immediate recrawling. |
| Post-migration | Monitor for crawl errors in Search Console (daily for 2 weeks) | Watch for 404s, redirect chains, and indexing issues. Fix immediately. |
| Post-migration | Track rankings daily for 4–8 weeks | Expect temporary fluctuations. Rankings should stabilize and improve within 6–12 weeks. |
| Post-migration | Keep 301 redirects active permanently | Never remove 301 redirects. They preserve link equity from external sites linking to old subdomain URLs. |
Hosting & Server Setup
Serving a subdirectory from a different application or CMS requires a reverse proxy. Here are the most common configurations:
Nginx, Reverse proxy WordPress blog at /blog/
server {
server_name example.com;
# Main site (React/static)
location / {
root /var/www/main-site;
try_files $uri $uri/ /index.html;
}
# Blog subdirectory → WordPress on port 8080
location /blog/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Apache, Reverse proxy with mod_proxy
<VirtualHost *:443>
ServerName example.com
# Main site
DocumentRoot /var/www/main-site
# Blog subdirectory → WordPress on port 8080
ProxyPass /blog/ http://127.0.0.1:8080/
ProxyPassReverse /blog/ http://127.0.0.1:8080/
ProxyPreserveHost On
</VirtualHost>Decision Framework
Answer these questions to determine the right structure for your use case:
Does the content need to rank in Google and drive organic traffic?
Yes: → Subdirectory. You want link equity flowing to your main domain.
No: → Either works. Subdomain is fine for apps, staging, or internal tools.
Does the content run on a different platform or tech stack?
Yes: → Subdomain (or reverse proxy to subdirectory if technically feasible).
No: → Subdirectory. No reason to split if you can serve from the same stack.
Does the content target a completely different audience?
Yes: → Consider subdomain (or even separate domain) if audiences are truly unrelated.
No: → Subdirectory. Same audience = consolidated authority is always better.
Do you need independent deployment/scaling?
Yes: → Subdomain for operational independence. Or use reverse proxy + subdirectory for SEO benefits.
No: → Subdirectory. Simpler ops, better SEO.
Is this for security isolation (PCI compliance, sandboxing)?
Yes: → Subdomain (or separate domain). Security isolation trumps SEO consolidation.
No: → Subdirectory. Default to the SEO-optimal structure.
Frequently Asked Questions
Does Google treat subdomains as separate websites?
Will moving from a subdomain to a subdirectory hurt my rankings?
Is blog.example.com or example.com/blog better for SEO?
Do subdomains share cookies and sessions with the main domain?
What about shop.example.com for e-commerce, subdomain or subdirectory?
How do subdomains affect Google Search Console and analytics?
Can I use both subdomains and subdirectories on the same site?
Does the choice between subdomain and subdirectory affect site speed?
Need SEO-Optimized Hosting?
Find hosting providers that support subdirectory setups, reverse proxies, and the server configurations you need for optimal SEO performance.
Find SEO-Friendly Hosting