Cookies This site keeps only what it needs to work. There is no analytics and no advertising on it today, and nothing here follows you to other sites. Read the privacy policy

Choose what to allow
+92 312 8299940Free Quote
Blog

Subdomain SEO: Subdomain vs Subdirectory, in Plain Words

Subdomain SEO in plain words: how Google treats a subdomain, subdomain vs subdirectory, when each one wins, and how to move a blog into a folder.

By the Denwix team 11 min read

What a Subdomain Is

Subdomain SEO comes down to one decision. Do you put a section of your site at blog.example.com or at example.com/blog/? The first is a subdomain. The second is a subdirectory, which many people call a subfolder.

A subdomain is the part in front of your main domain name. In shop.example.com, the word "shop" is the subdomain. Your DNS points it anywhere you like, so it can run on another server, another CMS or another company's platform.

A subfolder, on the other hand, is just a path on the same host. It shares the same server, the same robots.txt and usually the same CMS. So, from a crawler's point of view, it is clearly part of the main site.

Diagram: blog.example.com as a subdomain beside example.com/blog/ as a subfolder, with shared and separate signals
Same content, two addresses: a subdomain stands a little apart, a subfolder sits inside the main site.

This guide explains how search engines treat each one. Then it shows when a subdomain makes sense, and how to move one into a folder. Our free SEO Checker flags pages on a subdomain, so we also explain that warning.

How Google Treats a Subdomain

Google says it can crawl, index and rank both setups well. Its team has made this point many times. However, "can rank" is not the same as "ranks the same on day one".

In practice, Google learns what a host is about from that host's own pages and links. So a new subdomain often starts with less trust than a folder on a strong main domain. It has to build its own signals, and that takes time. In one line, that gap is the whole subdomain SEO debate.

What a subdomain shares, and what it does not

  • Separate: robots.txt, the server, the TLS certificate (unless it is a wildcard) and often the CMS and its sitemap.
  • Separate in reports: a URL-prefix property in Search Console covers one host only.
  • Shared: the brand name, and a Domain property in Search Console, which covers every subdomain at once.
  • Linked, not merged: links between the main site and the subdomain help, but they count as links between two hosts.

Google's own guide to URL structure asks for simple, logical addresses. Neither option breaks that rule. Instead, the real difference is how much of the main site's strength each one can lean on.

Subdomain vs Subdirectory

Here is the short answer people want. For most small and mid-size sites, a subdirectory is the safer pick for SEO. A subdomain is the better pick when the section is truly a different product, team or platform.

Subdomain vs subfolder at a glance

  • Links: a folder gets the main domain's links straight away. A subdomain earns most of its own.
  • Setup: a folder needs the same server or a reverse proxy. A subdomain needs only a DNS record.
  • Tools: a subdomain can run any CMS or SaaS. A folder usually runs on the main site's stack.
  • Tracking: a folder shares cookies and analytics easily. A subdomain needs cross-domain settings in some tools.
  • Risk: a weak or spammy subdomain stays a little apart from the main site. A folder shares the main site's fate.

So the subdomain vs subdirectory question is really a trade-off. You swap a bit of shared ranking strength for freedom in how the section is built. Many brands accept that trade. Others regret it once the subdomain blog needs years to catch up.

Rule of thumb: if a visitor would see the section as part of the same website, put it in a folder. If they would see a separate app or store, a subdomain is fine.

When a Subdomain Is the Right Call

Subdomains are not a mistake. In fact, some of the biggest sites in the world use them on purpose. They fit best when the section lives a life of its own.

  • An app or dashboard, such as app.example.com, which search engines should not index anyway.
  • A hosted platform, such as a help desk, status page or store that only runs on its own host.
  • A different language or country, when a local team runs it. Folders work here too, though.
  • A separate product with its own audience, its own brand and its own link building.
  • A tool, like a pastebin or file host, that would slow the main site or need different security rules.

Our own pastebin is a good example. It runs on paste.denwix.com, because it needs its own strict security headers and its own storage. So our checker flags it, and that is fine. The warning is a reminder of the trade, not a verdict.

When it is not worth it

A blog is the classic case. People put the blog on a subdomain because WordPress was easier to install there. Then the blog grows, earns links, and none of that strength reaches the product pages. That is the subdomain SEO cost most sites never planned for.

When a Subfolder Wins

A subfolder wins whenever the content exists to help the main site rank. Blogs, guides, case studies, glossaries and docs all fall here. Each new article in a folder adds to the same host, so the whole site gets stronger.

A folder also keeps life simple. There is one robots.txt, one sitemap index, one certificate and one analytics setup. Besides, internal links between the blog and the product pages are ordinary internal links, which is exactly what you want.

What if the blog runs on another platform?

You can still serve it from a folder. A reverse proxy, set up in nginx, Apache or a CDN worker, sends example.com/blog/ to the blog's real server. The visitor and the crawler only ever see the main domain. Most hosts and CDNs have a guide for this.

A quick nginx example

location /blog/ {
  proxy_pass https://blog-host.example.net/;
  proxy_set_header Host blog-host.example.net;
}

After that, set the blog's own site address to https://example.com/blog/, so its links, canonicals and sitemap all use the folder address.

Why the SEO Checker Warns About Subdomains

Our SEO Checker reads the host of every page it scans. If the host has anything in front of the main domain, other than www, it shows a warning in the Address group.

Denwix SEO Checker warning row: Subdomain, paste.denwix.com is a subdomain of denwix.com
Example: the Subdomain warning in the SEO Checker report.

Tools such as Seobility show the same warning. They word it as "use a top level domain for better SEO results". That wording is a little strong. Still, the idea is the same: a page on a subdomain cannot lean on the main domain as fully as a page in a folder.

The warning costs very little in the score. So read it as a subdomain SEO question. Is this section separate on purpose? If yes, keep it and follow the checklist below. If not, plan a move into a folder.

The same row also checks one more thing. It makes sure the domain uses Latin letters only, because a name in another script shows up as punycode, such as xn--, in many programs.

Subdomain SEO Checklist

Keeping a subdomain is often the right call. In that case, good subdomain SEO means making it as easy as possible for search engines to connect it to the main site. Here is the checklist we use.

  1. Give it its own robots.txt, with a Sitemap line. A crawler reads robots.txt per host, so the main one does not cover it.
  2. Give it its own XML sitemap, and submit it in Search Console.
  3. Verify a Domain property in Search Console, so you see every host in one report.
  4. Link both ways. Put the main site in the subdomain's header and footer, and link to the subdomain from relevant main pages.
  5. Keep the brand the same: logo, name and design, so people and machines see one company.
  6. Add Organization schema with the same name, logo and sameAs profiles on both hosts.
  7. Use one canonical address per page, and never publish the same article on both hosts.
  8. Cover it with HTTPS, using a wildcard or its own certificate.

Our robots.txt generator and XML sitemap generator cover the first two steps in a few minutes.

How to Move a Subdomain into a Folder

Moving a section from a subdomain into a subfolder is a site migration. So treat it with care. Done well, the new folder usually ranks at least as well within a few weeks. Done badly, traffic drops for months.

Step 1: List every address

Crawl the subdomain and export every URL that returns 200. Add the URLs from its sitemap and from Search Console, so nothing is missed.

Step 2: Map old to new

Write one new folder address for each old one. Keep the slugs where you can. For example, blog.example.com/seo-tips/ becomes example.com/blog/seo-tips/.

Step 3: Serve the content from the folder

Install the section on the main site, or set up the reverse proxy shown above. Next, update canonicals, internal links, images and the sitemap to the new addresses.

Step 4: Redirect with 301s

Send every old address to its new one with a permanent 301 redirect, one to one. Never send them all to the home page. Our redirect chain checker shows whether each hop lands in one step.

# On the old blog host (Apache)
RewriteEngine On
RewriteRule ^(.*)$ https://example.com/blog/$1 [R=301,L]

Step 5: Watch and wait

Submit the new sitemap. Then keep the redirects in place for at least a year. Meanwhile, watch Search Console for 404s and fix them as they appear.

Common Mistakes

  • Putting the blog on a subdomain only because the install was easier.
  • Publishing the same articles on the subdomain and on the main site, which splits every signal.
  • Forgetting the subdomain's robots.txt, so a "Disallow: /" left over from staging blocks everything.
  • Leaving staging or test subdomains open to crawlers. Protect them with a password instead.
  • Moving a subdomain into a folder without 301 redirects.
  • Linking to the subdomain only from the footer, so it looks unimportant.

Each of these subdomain SEO mistakes is easy to avoid once you know it exists. For the official view on site structure and moves, the Search Console help on adding a property explains how Domain and URL-prefix properties differ.

Questions and Answers

Is a subdomain bad for SEO?

No. A subdomain can rank well. However, it usually has to earn more of its own links and trust than a folder on the same domain would.

Subdomain vs subdirectory: which is better for SEO?

For a blog or guides that should help the main site rank, a subdirectory is usually better. For a separate app, store or platform, a subdomain is fine.

Does Google treat a subdomain as a separate site?

Partly. Google can connect it to the main site, but it learns about each host from that host's own pages and links. Reports and robots.txt are also separate per host.

Is www a subdomain?

Technically yes. In practice, though, www is treated as the main site, so our checker does not warn about it. Just pick one version and redirect the other.

Do backlinks to a subdomain help the main domain?

Some value can flow through the links between them. Still, links to a folder help the main domain more directly.

Should my blog be on a subdomain?

Usually not. A blog in a folder adds every article to the main site. Use a subdomain only if the blog truly cannot run under the main domain.

Can I run a different CMS in a subfolder?

Yes. A reverse proxy in your server or CDN can serve another platform under a folder such as /blog/.

Does a subdomain need its own robots.txt?

Yes. Crawlers read robots.txt per host, so blog.example.com/robots.txt is separate from example.com/robots.txt.

Does a subdomain need its own sitemap?

It is best to give it one, list it in that host's robots.txt, and submit it in Search Console.

How do I see a subdomain in Search Console?

Add a Domain property. It covers every subdomain in one place. A URL-prefix property covers only one host.

How long does a subdomain take to rank?

There is no fixed time. A new subdomain often takes longer than a new folder, because it starts with fewer signals of its own.

How do I move a subdomain to a subfolder?

Map every old address to a new one, serve the content from the folder, add one-to-one 301 redirects, update the sitemap, and watch Search Console.

Will I lose traffic when I move a subdomain?

A short dip is common. With clean 301 redirects, most sites recover within a few weeks, and the folder often ends up stronger.

Are country subdomains good for international SEO?

They work, and so do folders such as /de/. Folders are simpler to run, while subdomains suit local teams. Either way, add hreflang.

Does a subdomain need its own SSL certificate?

It needs to be covered by one. A wildcard certificate covers every subdomain, or each one can have its own.

Can a bad subdomain hurt my main site?

It stays a little apart. Even so, spam on any of your hosts can hurt your brand, so keep every subdomain clean.

Should staging subdomains be indexed?

No. Protect them with a password. A noindex tag alone still lets anyone open the pages.

What is a subfolder in a URL?

It is a path on the same host, such as /blog/ in example.com/blog/. It shares the server, robots.txt and links of the main site.

Why does Seobility say to use a top level domain?

It flags any page on a subdomain, because such a page cannot fully lean on the main domain. If the subdomain is separate on purpose, you can keep it.

How do I check if a page is on a subdomain?

Scan it with the free Denwix SEO Checker. The Address group shows a Subdomain row, and its How to fix link brings you to this guide.

Video guide

How to Check a Page for the Subdomain Warning

A short video walks through every step. Then pick your language below, and turn on captions if you like.

Check Your Own Page in a Minute

Scan any address with the free SEO Checker. It flags subdomains and runs more than 100 other checks.