If you really dig deep enough to do your technical SEO correctly, you will hear the terms “subdomain” and “subdirectory.” Both are equally important in SEO, but you must know what they are used for.
Today, this is going to be our point of discussion. What is the difference between the two? By the end of this website subdomain vs. subdirectory tutorial, you will understand what they are used for, and you should be able to organize your website files to improve your SEO.
What is a subdomain?
A subdomain is a part of your main domain. Let us say that your website’s name is ABC.com. In this case, a subdomain will look like this:
As you can see, the “blog” part is a domain, but it is a part of your main domain name.
Why do people do this?
Website masters do this because they want to organize their website. The ABC part of the domain is the top-level, and the “blog” part is the subdomain. The subdomain is like a room inside a big facility, like a gym.
If you are in such a large facility, you know that everything related to health and fitness is in the gym area. The webmasters and content creators know that every blog post must be in the “blog” subdomain for subdomains.
Google and other search engines also know this. On top of that, users will find it easier to remember the URL. Next time, they will just type that URL, and they will go directly to the area of your website that they are looking for.
Lastly, a subdomain appears BEFORE the main domain name.
What is a subdirectory?
A subdirectory is like a subdomain. However, there is a difference in how the files or folders are arranged. In our example, this is going to be how a subdirectory looks like:
As you can see, the subdirectory comes AFTER the domain name. The way people read this is almost similar to the subdomain, albeit it is not easier to type because of the slash. The thing is that a person who views two URLs, he will interpret both a subdomain and a subdirectory in the same way.
How does this all work?
Should you choose a subdomain or a subdirectory? How do these things work?
The reality is that these two things are almost trivial if you have a small website. But if you are a big company like Amazon, then it is far better to have subdomains. To help you understand why we need to step back a little and see how they differ at the backend.
The old internet system uses subdirectories. A subdirectory is pretty much automatic, especially so if you are using content management systems like WordPress.
The way subdirectories work is like a filing cabinet where the cabinet is your domain name. Inside it is folders, and each folder has a label. Inside each folder is a file.
For abc.com/blog, the subdirectory “blog” is like a folder. In this folder file for your articles. The “blog” folder contains an HTML file, and the server will read that HTML file if someone tries to access that URL.
However, this kind of folder system will not work if the “blog” folder is hosted remotely.
How come it does not work?
Because in the modern era of the internet, the root domain is often hosted in different machines in different parts of the world. What this means is that your URLs, like abc.com/blog, are not affected by the abc.com domain.
To make these two things work together, you need NGINX, also called a reverse proxy, to make traffic get directed to abc.com/blog if the traffic is actually coming from your hosted blog hosted from another server.
If you use a subdomain, like blog.abc.com, it is easier for machines to find that content. What happens is that your hosted blog, which is hosted by another website, can be easily configured to be connected to your root domain name, which is abc.com.
Do I have this problem?
This problem only happens if your blog is hosted somewhere else and not the same with the server hosting your domain and other pages.
Let us say that you bought a hosting plan from Siteground. In it, you use WordPress. This is the most common thing to do. If this is the route you took, your website structure is automatically a subdirectory.
On the other hand, big websites do not do this.
They will host their blog data on one provider like Siteground. Then they will host their forum pages on another provider, like Bluehost. It is in a situation like this when a subdomain is used.
Why do they do this?
They do this to protect their site content. If one host is down, it does not mean that all the subdomains are down. This is why sometimes, a site’s blog page is accessible, but its forum site is not. It happens because the subdomain host of the forum is experiencing downtime.
Does this affect SEO?
Website subdomain vs. subdirectory: how does it affect SEO?
Not directly. Both the subdomain and subdirectory approaches are viewed in the same light by Google. To Google, it does not matter.
What does this mean? It means that whether you use a subdomain or a subdirectory, you have the same chances of ranking on the search engine results pages.
However, how your hosts and servers perform will definitely impact your SEO. If you use a subdirectory, and you happen to have an unreliable host, your website will have downtimes. And if this happens, Google will not be happy because you are not providing the best user experience.
On the other hand, if you are using a subdomain, only a part of your website is impacted if the host server is down. Google will not penalize you that much—or not if nobody is accessing the part of your site that is currently experiencing the downtime.
Here are two good reasons why a business must use a subdomain:
- Support – your customer support channel must be hosted on another subdomain to not clog the bandwidth of your main domain.
- Different regions – if you are catering to different countries with different languages, you might as well host those files in servers close to the target countries.
You may also consider using subdomains if you have a busy site, such as a big e-commerce store or a site where you host events. An example of an event is a webinar or a gambling website where there is a lot of bandwidth needed for each part of your business.
Summary: Website Subdomain Vs. Subdirectory
If you are a blogger or operating a small business, the way to go is a subdirectory. This is the most common practice, and it does not require many things to set up.
For small businesses, it is not financially logical to take the subdomain approach. What happens here is that you are going to pay different hosting service providers. You only pay one. However, if that server is down, your entire website is down.
https://youtu.be/X3a-xqY93aM As far as traffic and user behavior is concerned, Google Analytics is the only thing you need. Apart from being easy to use, Google is the largest and most dominant...
https://youtu.be/VnjeR-bsRM4 If you have heard of WordPress but haven't yet given it a try, here are some inspiring WordPress sites that you can use as a source of motivation. To give you an idea...