Should you use subdomains or subdirectories to store different parts of your website? And how does it affect your SEO? Let’s find out!
We were recently in a situation where we had to make an important decision that affects both SEO and UX. Our client, Zaizon, had a website with a blog, and a webshop.
The immediate questions that struck us were:
- Should thew webshop be on a subdomain or a subdirectory?
- Should the blog be on a subdomain or a subdirectory?
Using the subdomain approach (domain separation) would look like this:
- zaizon.dk (main info page)
Using the subdirectory approach it would look like this:
- Zaizon.dk (main info page)
There are distinct advantages to either approach.
We ultimately decided to go with the second approach, using subdirectories. Next up I’ll discuss the main factors that influenced our decision.
1. A specific focus area
Zaizon, the physical store, sells the same products that the digital store sells. The purpose of the Zaizon blog is to talk about things that are relevant for customers who buy their products. Every unit has a different role, but they all have the same focus area.
Some brands websites have many different sections and priorities (a variety of concerns), which might not always align well with each other. In that case, it makes perfect sense to use subdomains, like store.brandname.com, blog.brandname.com.
An example of that is BBC.
But Zaizon is not a huge cooperation with multiple categories of media and dozens of different concerns (topics). Zaizon is a small, high-end connoisseur store with one specific focus:
- To educate their customers about their products.
- To make the experience pleasant and easy to digest, in both the online and the physical store.
- To make more money (shocking, I know!).
Whether it’s Zaizon’s front page, about page, blog, or store, the main focus remains the same. And that’s one of the main reasons we decided to go with subdirectories instead of subdomains.
2. SEO (subdomain vs subdirectory)
When you separate your website into subdomains, each subdomain will be treated as a different domain by the search engines. This has a massive impact on SEO (Search Engine Optimization).
If we had split Zaizon into zaizon.dk blog.zaizon, webshop.zaizon, Google would address those as three different websites.
In other words: we would now have to do SEO separately on each domain. That wouldn’t make any sense since each concern (main page, blog, webshop) have the same objective.
Zaizon.dk (main page) already had great SEO. If we had separated everything, none of the main pages SEO would directly carry-over to the blog and the shop. We would essentially have to start from scratch.
This wasn’t ideal, and that made our decision to go with subdirectories instead of subdomains even easier.
3. Technology Compatibility
At TechStacker, we strive to use the same technologies in every digital product we build. Whether we’re building a webshop, a booking system, a blog, or a message board.
There might be the odd case where this isn’t possible, and we will address that issue accordingly. But for the most part, it’s perfectly doable to use the same technologies to build different products.
At least it is if your team follows specific systems and conventions that allow them to put together products as if they were assembling lego blocks. It’s easier said than done but totally possible.
Let’s say you have a blog. Let’s say your blog is built with WordPress. WordPress is written in PHP (programming language).
Your blog starts becoming popular, and then you decide to expand and add a message board.
You hire some skilled developers to build your messageboard.
But then it turns out that your message board is using Python (programming language) on the back-end — not PHP which your WordPress site uses.
Python and PHP are very different languages.
While it’s definitely possible to use two different back-end languages under the same domain, there are practical reasons to separate the two.
If you hire someone to build your message board on a subdomain, they’re working on a domain which is technically isolated from the main domain. This means that issues like code conflicts, overlapping, redundancy, and responsibility can’t get mixed up in the process.
The Python developers work on messageboard.yourdomain.com
The WordPress/PHP developers work on yourdomain.com
With this type of setup, nobody can intentionally/unintentionally interfere with the others work. That’s a huge benefit, for both the developers and the website owner.
It also means that if one of your apps crashes for whatever reason, the other one is likely to stay online. Unless both apps are hosted on the same server, and the server happens to get taken down (hacked, or whatever).
This benefit because if one of your product’s domains goes temporarily offline, you can announce it on your other domain so your audience knows what’s happening.
There are upsides and downsides of using subdomains or subdirectories. As a rule of thumb:
- If every part of your website (blog, shop, messageboard) has the same or similar objective, subdirectories make a lot of sense. Especially if you want to simplify your SEO efforts.
- If you use a bunch of different technologies for different parts of your website built by different developers, then using subdomains is often the most practical solution.