Subdomain or Subfolder: Which Is Better for SEO?
Both subdomains and subfolders can rank. This guide explains the real differences, the situations where each fits, and the setup and migration details that matter.
10 min readUpdated Nov 28, 2026By XPASS Editorial Team

Sooner or later almost every website owner has to decide where a new section should live. You add a blog, a shop, a help centre or a second language, and the question appears: should the address be blog.example.com or example.com/blog? The first form is a subdomain and the second is a subfolder, also called a subdirectory. Online discussions about this question are often loud and sure of themselves, which is unhelpful because the honest answer is that both work and the right one depends on your situation.
This guide explains what each form really is, how search engines are generally understood to treat them, and which kinds of sites tend to benefit from each approach. It then walks through setup steps, a plain example, and the details that cause trouble later, such as certificates, analytics and migration. If you are also planning more than one language, the related guide on choosing a domain and subdomain for a multilingual site goes deeper on that special case, and the article on how much a domain name affects Google ranking puts the wider question of domain choice in proportion.
What a subdomain and a subfolder actually are
A domain name is read from right to left. In www.example.com the final part, com, is the top-level domain, example is the registered name, and www is a label placed in front of it. Any label you add in front of the registered name creates a new hostname, and that hostname is called a subdomain. So blog.example.com, shop.example.com and support.example.com are three subdomains of example.com. The structure of the name system that makes this possible is described in RFC 1034.
A subfolder is different. It is a path after the hostname. In example.com/blog the hostname is still just example.com, and /blog is a directory on that same web server or application. Visitors and search engines see one hostname with many paths.
That technical difference has practical consequences. A subdomain has its own DNS record, can point to a completely different server, can use a different platform, and needs to be covered by a certificate. A subfolder normally lives inside one application, shares the same server configuration, and is covered by the certificate you already have.
| Point of comparison | Subdomain (blog.example.com) | Subfolder (example.com/blog) |
|---|---|---|
| Hostname | A new, separate hostname | The same hostname as the main site |
| DNS | Needs its own record or a wildcard record | No extra DNS record |
| Certificate | Must be covered by the certificate | Covered if the main name is covered |
| Hosting | Can run on a different server or platform | Usually the same server or application |
| Search Console | Often managed as its own property | Part of the main site property |
| Typical effort | More moving parts | Simpler to maintain |

How search engines generally treat them
Search engines crawl and evaluate pages at the URL level, but they also build a picture of a site as a whole. The usual guidance from Google is that it can work with both structures and that there is no inherent penalty or bonus for either. What differs is how much work you must do to give each section its own strength.
When content sits in a subfolder, every page shares the same hostname. Links that point to the blog also point to a hostname that the home page, the product pages and the rest of the site share, and internal links between them are ordinary links inside one site. The signals around the site, such as its age, its links and its reputation, are naturally concentrated in one place.
When content sits in a subdomain, search engines may treat it as closely related to the main site in some respects and as a distinct section in others. In practice that means the subdomain often needs its own internal linking, its own sitemap, its own monitoring and its own link building before it performs as well as it could. This is not a rule of nature. It is a reason why splitting a small site into several subdomains rarely helps and sometimes slows things down.
Be cautious about anyone who promises an exact ranking effect from this choice alone. Rankings depend on content quality, relevance, links, page experience and many other factors described in the Google Search Central SEO Starter Guide. The structure of your addresses is one input, and usually not the biggest one.
When a subfolder is the better choice
A subfolder is the sensible default for most small and medium business sites. Choose it when the new section is part of the same story as the main site and is managed by the same people.
A company blog that supports the main product is the classic example. The articles attract readers, link to product pages, and receive links from other sites. If the blog lives at example.com/blog, all of that activity strengthens one hostname, and a reader moving from an article to a product page never leaves the site. Measurement is also simpler, because one analytics property and one Search Console property show the whole journey.
A subfolder is also a good fit for a help centre or documentation that is closely tied to the product, for case studies, for resource libraries, and for language sections when you run all languages from one content system. Having a single hostname means fewer certificates, fewer DNS records, fewer places where a setting can be forgotten, and fewer chances for a redirect rule to behave differently in two places.
The cost is flexibility. A subfolder usually means the section must run on the same platform, or that a reverse proxy has to hand certain paths to a different system. This is entirely possible, but it needs someone who understands how to configure the web server or the content delivery layer.
When a subdomain is the better choice
A subdomain makes sense when the section is genuinely a different product or a different system. Consider these situations.
- The section runs on a separate platform. A hosted shop or a hosted help desk often asks you to point a subdomain at the vendor with a single DNS record, which is much easier than rebuilding paths on your main server.
- A different team owns it. If one group manages the application and another manages the marketing site, separate hostnames reduce the chance that one deployment breaks the other.
- Security or cookie separation matters. Cookies can be scoped to a hostname, so a customer portal or an admin area on its own subdomain is easier to isolate from the public site.
- It is a distinct brand or audience. A product with its own audience, such as a developer portal beside a consumer site, can have its own identity.
- It is a temporary or experimental environment, such as a staging copy. You should normally keep those out of search results anyway, and a separate hostname makes that easier to enforce.
None of these reasons is about SEO. They are about operations, security and ownership. That is the right way to think about the choice: decide based on how the section is built and who runs it, then add the SEO work needed to support it.
Special cases that come up often
Blogs and content marketing
If the blog exists to bring in search traffic for the business, keep it in a subfolder unless a technical reason prevents it. Moving it later is possible but is a migration with risk.
Online shops
A shop that is the main purpose of the site usually belongs at the root or in a subfolder. A shop added to a content site by a third-party platform is often delivered on a subdomain, and that is acceptable. In both cases make sure product pages have clear titles, unique descriptions and a sitemap.
Multiple languages
Language sections can use subfolders such as example.com/th/, subdomains such as th.example.com, or separate country domains. Subfolders are the simplest to maintain, and each option needs correct language annotations so search engines can match the right page to the right reader. The dedicated guide on multilingual site domain choices compares these options in detail.
Customer portals and applications
Logged-in areas are usually not meant to be found through search. A subdomain such as app.example.com or portal.example.com keeps the application cleanly separated, and you can block it from indexing while the public site remains open.
Staging and test sites
A staging copy should never compete with the live site. Put it on its own hostname, protect it with a password or an IP allow-list, and make sure it is not indexed.
How to set each one up
Setting up a subdomain
- Decide the name. Keep it short, readable and stable, for example blog or help.
- In your DNS settings, create a record for the name. A CNAME record points the name at another hostname, which is the usual instruction from a hosted platform. An A record points it to an IPv4 address, and an AAAA record points it to an IPv6 address.
- Configure the server or platform to accept the new hostname. Many platforms need you to add the domain in their dashboard as well as in DNS.
- Make sure a certificate covers the new name. See the certificate section below.
- Add the new hostname to your analytics and to Search Console, submit its own sitemap, and check that robots rules are correct.
- Link to it from the main site so visitors and crawlers can find it.
Setting up a subfolder
- Create the directory or route in your content system or application, for example /blog.
- If the section runs on a different system, configure the web server or content delivery layer to forward that path, and confirm that links and assets resolve correctly under the path.
- Add the section to the existing sitemap or create a sitemap index that includes it.
- Check that canonical addresses use the same hostname and the same path form, and that old addresses redirect permanently.
- Link to it from the navigation and from relevant pages.
A plain example
Imagine a small training company with a main site at example.com. It wants a blog, an online booking system and a help centre.
The blog is written by the marketing person, uses the same content system as the main site, and exists to attract search traffic for course topics. The owner puts it at example.com/blog. The articles link to course pages, the course pages link back to articles, and all of it is measured together.
The booking system is a hosted service. The vendor asks the company to create a CNAME record so that book.example.com points to the vendor. The owner follows the instruction, adds the name in the vendor dashboard, and confirms that the certificate covers it. Nobody expects the booking pages to rank, so a separate hostname costs nothing.
The help centre is a small set of articles about common questions. Because the content is short and closely tied to the courses, the owner puts it at example.com/help. If it grows and a separate team takes over later, a move to help.example.com can be planned then.
The result is one subfolder section where search traffic matters, one subdomain where a vendor requires it, and a choice for the third that can be revisited. Nothing here depends on a rumour about which structure ranks better.

Certificates, DNS and other technical details
A certificate must match the hostname that visitors use. A certificate issued only for example.com does not automatically cover blog.example.com. You have three common options: add the extra name to the certificate, use a certificate that lists several names, or use a wildcard certificate that covers any single label in front of the registered name. A wildcard covers blog.example.com but not a deeper name such as eu.blog.example.com. If you are weighing these, the SSL certificates page explains what is available and what each type covers.
DNS deserves care too. If you use many subdomains, keep a list of every record and who owns it. Records that point to services you have stopped using can be taken over by someone else, which is a known security problem called subdomain takeover. Remove records you no longer need.
Cookies and tracking behave differently. A cookie set for example.com can usually be read by its subdomains, while a cookie set for a single subdomain is limited to it. Analytics tools often need extra configuration to follow a visitor across hostnames, and without it a single visit may look like two. Check how your analytics handles cross-hostname sessions.
Performance is not a reason to prefer one over the other. A separate hostname can mean a separate connection setup, which is a small cost. A subfolder served from the same hostname can reuse an existing connection. Either difference is tiny compared with image sizes, scripts and server response time.
Limits and what to watch for
- Do not split a small site into many subdomains. Every subdomain needs its own content, links and care. Splitting a ten-page site into five hostnames dilutes attention.
- Do not rely on a single claim about ranking. Treat the structure as an operational decision and judge results with your own data.
- Avoid changing the structure repeatedly. Each move is a migration, and every migration carries some risk of lost visibility.
- Keep addresses consistent. Choose one form for the hostname, with or without www, one protocol, and one trailing-slash style, and redirect the others permanently.
- Do not forget the sitemap, robots rules and Search Console. A new subdomain does not appear in your existing property automatically, so add it deliberately.
- Make sure each hostname is covered by a valid certificate. A warning page in the browser hurts visitors far more than any structural choice helps.
- Remember email. If you run business email on the same domain, DNS changes for the website should not disturb the records that email depends on. A short review of the existing mail records before editing is worth the time.
Moving from one structure to the other
Sometimes the original choice turns out wrong, and a section needs to move. The process resembles any domain migration, and the guide to a domain migration checklist for a rebrand covers the full list of steps. In short:
- Build a table that maps every old address to its new address, one to one where possible.
- Set up permanent 301 redirects from each old address to its matching new address, not to the home page.
- Update internal links, canonical tags, sitemaps and structured data so they use the new addresses.
- Keep the old addresses redirecting for a long time, normally at least a year.
- Submit the new sitemap, watch Search Console for errors, and compare traffic against a baseline taken before the move.
- Expect temporary fluctuations while search engines re-crawl and re-evaluate the pages.
Moving content costs effort, so make the decision once, carefully, and avoid reversing it.
Summary
Both subdomains and subfolders are valid, and neither is a shortcut to better rankings. A subfolder keeps everything under one hostname and is usually simpler and easier to build up, so it is a good default for blogs, help content and other sections that belong to the main site. A subdomain is the better tool when a section runs on a separate platform, belongs to a different team, needs isolation, or serves a distinct audience. Decide based on how the section is built and who maintains it, cover every hostname with a certificate, keep addresses consistent, and plan carefully before you move anything later.
If you are choosing a name for the main site or planning how its sections will be organised, the domains page is a good place to start.
Frequently asked questions
Does Google prefer subdomains or subfolders?
Google has said it can handle both, and it does not publish a rule that one always ranks better. In practice a subfolder keeps everything under one hostname, which is simpler to manage, while a subdomain is treated as a separate hostname that you may need to build up on its own.
Should my blog live on blog.example.com or example.com/blog?
For most business sites, example.com/blog is the simpler choice because the blog and the main site share one hostname, one set of internal links and one place to measure. Use a subdomain only when the blog runs on a different platform or team and a separate hostname is genuinely easier.
Do I need a separate SSL certificate for a subdomain?
A certificate must cover every hostname that visitors use. A single-name certificate for example.com does not cover blog.example.com. You can add the name to the certificate, use a multi-name certificate, or use a wildcard certificate, depending on what your certificate provider supports.
Can I move from a subdomain to a subfolder later?
Yes, but treat it as a migration. Map each old address to its new address, use permanent 301 redirects, update internal links and sitemaps, and watch Search Console afterwards. Expect some temporary movement in rankings.
Is a subdomain bad for SEO?
No. Many large sites use subdomains successfully. The point is that a subdomain is a separate hostname that needs its own links, content and monitoring, so it rarely makes sense to split a small site into many of them.
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Ready to register your domain?
Search a name, compare extensions and pay once for the years you choose.
.com registration from $18.81 for the first year
Search domainsKeep reading

Domain & DNS Guides
Multilingual Website: Choosing Domains and Subdomains
Country domains, subdomains or subfolders: each way of structuring a multilingual website has trade-offs. Learn how to choose and how to set it up cleanly.
10 min read

Domain & DNS Guides
How Much Does a Domain Name Affect Google Ranking?
Keywords, extensions, length and age: which parts of a domain name really influence Google rankings, and which are myths? A practical guide to choosing well.
9 min read

Domain & DNS Guides
Domain Migration Checklist for a Business That Is Rebranding
A rebrand usually means a new domain name. This checklist covers what to prepare, how to redirect the old address, and what to verify after the switch.
10 min read