Sooner or later, almost every growing website faces the same small but surprisingly important decision. You want to add a blog, a store, a help center or a members area, and you have to decide where it lives. Should it be blog.example.com or example.com/blog?
The first is a subdomain. The second is a subdirectory (sometimes called a subfolder). Both work, both are common, and both can rank well in search. But they behave differently behind the scenes, and the right choice depends on what you are building and how you plan to run it.
What is a subdomain?
A subdomain is a prefix added in front of your main domain name, separated by a dot. In shop.example.com, the word shop is the subdomain. Technically, www is a subdomain too.
Because a subdomain is its own hostname, it can point anywhere. You can create a DNS record that sends shop.example.com to a completely different server, a hosted store platform or a third-party help desk, while example.com stays on your regular hosting account.
Common uses for subdomains include:
- Separate applications such as a client portal, webmail or a support desk
- Hosted services run by another company (a store builder, status page or newsletter archive)
- Regional or language sites, like
uk.example.com - Staging or testing copies, like
staging.example.com
What is a subdirectory?
A subdirectory is simply a folder path on your main domain. In example.com/blog, the /blog part is a subdirectory. It lives on the same hostname as your homepage and is usually served by the same hosting account and, often, the same application.
Subdirectories are the default way most sites organize content. Your services pages, your blog posts and your about page are all typically subdirectories of one domain.
How search engines see each option
This is where most of the debate happens. Google has said publicly that it can handle both structures and that you should choose whichever is easiest for you to maintain. That is true: a well-built subdomain can rank perfectly well.
In practice, though, there are a few things worth understanding:
Subdirectories keep everything under one roof
When your blog sits at example.com/blog, every link someone gives to one of your articles points to your main domain. Search engines clearly see one site with one set of signals. Internal links between your blog and your service pages feel natural, and the content strengthens the domain as a whole.
Subdomains can be treated more like separate sites
Search engines are generally good at figuring out that blog.example.com belongs with example.com, but a subdomain is still a separate hostname. In Google Search Console, for example, you have to use a domain property (or add the subdomain separately) to see its data. If the subdomain runs on different software with a different design and navigation, it can look and act like a separate website, and you may need to work harder to connect the two.
The honest summary
For content that is meant to support your main brand in search, such as blog posts, guides and resource pages, a subdirectory is usually the simpler and safer choice. For things that are truly separate applications or are hosted elsewhere, a subdomain is often the practical choice, and SEO is rarely the deciding factor for those pages anyway.
Technical and practical differences
SEO is only part of the picture. The way you host and maintain each option matters just as much.
Hosting and setup
- Subdomain: Created in your control panel or with a DNS record. In cPanel and DirectAdmin you can create a subdomain in a few clicks and give it its own document root folder. If it points to an outside service, you usually add a CNAME record that the service gives you.
- Subdirectory: Usually just a folder or a section inside your existing site. If you want a separate application (say, a WordPress blog under a static site), you install it into a folder like
public_html/blog.
Running a different platform in a subdirectory on another server is possible with a reverse proxy, but that is an advanced setup. If your store or help desk is a hosted service, a subdomain is almost always the realistic option.
SSL certificates
Every hostname needs to be covered by your SSL certificate. A subdirectory is automatically covered by the certificate for your main domain. A new subdomain needs its own certificate or a wildcard certificate. Most modern hosting control panels issue free certificates for subdomains automatically, but it is worth checking that https:// works right after you create one.
Cookies and logins
Cookies can be shared across subdomains if they are configured that way, or kept separate. Subdirectories share the same origin, which is simpler for things like a single login, but it also means a vulnerable plugin in one part of the site sits closer to everything else.
Analytics
A subdirectory shows up in your existing analytics automatically. A subdomain may need cross-domain or cross-subdomain settings so that visitors moving between the two are not counted as new sessions.
When to choose a subdirectory
Pick a subdirectory when:
- The section is content you want to rank and support your brand (blog, guides, case studies, location pages)
- It can run on the same platform as your main site
- You want one design, one navigation and one analytics setup
- You do not have a strong technical reason to separate it
When to choose a subdomain
Pick a subdomain when:
- The section is a separate application or is hosted by another provider
- It needs different server settings, software versions or security rules
- It is aimed at a different audience, such as staff, partners or logged-in clients
- You want to isolate risk, for example a test site that should never affect production
What if you already chose the "wrong" one?
You can move content from a subdomain to a subdirectory (or the other way) later. The key is to do it carefully:
- Map every old URL to its new URL.
- Set up permanent 301 redirects from each old address to its new one.
- Update internal links, your sitemap and any canonical tags.
- Check Search Console for crawl errors over the following weeks.
Expect some fluctuation while search engines process the change. Done properly, most sites recover and often end up stronger because their content is consolidated.
Quick decision checklist
- Is it marketing or educational content? Lean toward a subdirectory.
- Is it a separate tool, portal or third-party service? Lean toward a subdomain.
- Can your current platform host it easily? A subdirectory is simpler.
- Does it need its own server or settings? A subdomain is cleaner.
Wrapping up
There is no universal winner in the subdomain vs subdirectory debate. Subdirectories are usually the better fit for content that should build your main site's visibility, while subdomains shine for separate applications and outside services. Decide based on how the section will be built and maintained, keep your URLs consistent once you choose, and you will be in good shape either way. If you are still getting comfortable with how hostnames and records work, our guide to DNS records explained is a good next read.