When your site – and business – starts growing, it often becomes relevant to create one or more subdivisions of your site, such as a microsite, blog, forum, product launch pages, campaign pages, etc. As you probably already know, there’re two most common options for creating a subdivision of a site: hosting it on a subdomain or in a subdirectory.
Here you’ll learn what exactly each of them implies and how they differ from a hosting, SEO, and technical point of view.
Which is Which
A subdomain is a subdivision of a site, where the name of the subdomain is “attached” to the domain name like this: subdomain.domain.com. Using subdomains was quite common years ago but seems to have lost popularity in the past decade. Partially due to SEO concerns and partially because they sometimes perceived as “free” sites, often connected to spam, aggressive advertising, and similar negative experiences. Even so, giants as Google still hold on to subdomains as a preferred (or established) way to host multiple subdivisions of their site or brand-related services.
A subdirectory is likewise a subdivision of a site. However, the name of the subdirectory is appended to the domain like this: domain.com/subdirectory/. This method of hosting a subdivision of a site becomes more and more common due to reasons as SEO, technical considerations, hosting limitations, etc. Additionally, a subdirectory allows for maintenance of more holistic and universal user experience throughout the website, as well as stronger brand awareness.
For both applies that an extra installation is present. It might be a whole WordPress installation, forum software, surveys, recruitment software, and much more. Most often, they share the main domain’s branding and strategic goals. They are created to support the main site by extending its offering.
Subdomain vs. Subdirectory from Hosting Perspective
If you are wondering, whether you should install a site subdivision on a subdomain or in a subdirectory, the very first consideration you should make is hosting-related. Does your hosting plan allow for creation of subdomains or not?
If the answer is no, you should really consider, whether it is necessary to use a subdomain. Changing your hosting plan or provider will cost a lot. In the same time, you can achieve the same effect of a separate web space by using a subdirectory. No hosting plan limits you in relation to using subdirectories. As long as you have a spare MySQL database to use, you can create a subdirectory installation.
Subdomain vs. Subdirectory from SEO Perspective
From SEO perspective, the question whether to use a subdomain or a subdirectory is more interesting. In 2016, John Mueller from Google was quoted to say that the algorithms are getting pretty good at figuring out, which subdomain or subdirectory should be treated as a part of a main site and which shouldn’t. This means that none of the options should be better or worse for your SEO.
The only thing one should be on the lookout for, is using wildcard subdomains, where a vast number of subdomains should be crawled and classified, possibly as separate hosts. This could make crawling very difficult and thus hurt the SEO of the main site or its subdomains.
Even though, Google is quite confident about their ability to recognize the true role of a site’s subdivisions, and I am convinced that they’ll only get better now, after beginning to use the power of AI for real, there’re still a lot of SEO specialists and site owners out there, reporting that subdomains more often than not get treated as separate websites.
Therefore, as long as you have a well-established site, it might be the “safe” choice to use subdirectories. If you, on the other hand, have SEO-troubles with your main site, you might want to try your luck with a subdomain structure.
Be though aware that the SEO-aspect of the matter isn’t exhausted by this. There’re two other important SEO-elements to consider: backlinks and freshness.
While, as mentioned above, there, in theory, shouldn’t be a difference in the way Google treats subdomains and subdirectories, there isn’t a doubt that a subdirectory is best to transfer link juice and contribute to the freshness factor of your domain. Thus, if you plan to create a blog or a similar content-driven subdivision of your site, it’s best to host it in a subdirectory. Content-driven sites are a good source of quality backlinks and freshness.
On the other hand, exactly because subdomains sometimes are treated as separate sites, you can use them (wisely, please) to boost your backlink account. This isn’t considered possible, when using subdirectories.
To conclude, there, in theory, shouldn’t be a SEO-related difference between subdomains and subdirectories and there possibly won’t be in the future, once Google’s algorithms get good enough. For now, however, you might experience such a difference, as described above. You should therefore make a decision, which option to use, based on the advantages and disadvantages, applying to your specific situation.
Subdomain vs. Subdirectory from Technical Perspective
From technical perspective, subdomains and subdirectories are both the same and very different.
They are the same in terms of impact on website performance and folder tree on the server. Both subdomains and subfolders impact website performance, as they use up some of the hosting resources, allocated to you. In most cases, you’ll only be able to notice this, if your website or its subdivision(s) are very busy and are on the verge of exceeding the limits of the hosting account. However, in cases where the server’s bandwidth or RAM are limited, you can always expect some drop in website performance due to the fact that the different installations share the available resources.
From a performance point of view, there isn’t a difference between subdomains and subfolders, though. Neither of the options is better or worse.
From a file structure perspective, subdomains and subdirectories are completely the same. In fact, you won’t be able to tell, which is a subdomain and which a subfolder, only by looking at the folder tree on the server.
The differences begin, when you start trying to set up your site correctly: cookies, Analytics, Webmaster Tools, SSL, etc.
If you use Google Analytics to track traffic on your site, using a subdirectory structure offers simplicity of implementation: you only have to add the same GA tracking ID you use on your main site. You basically don’t need to do any additional setup, as domains and subdirectories share cookies by default. You’ll only have to setup a filtered view, as long as you want to track traffic to the subdirectory separately.
If you though use a subdomain structure, you’ll have to add the analytics tracking code to your code again, set your cookies, and customize your Analytics view in order to be able to correctly track traffic.
The same applies to the range of Webmaster Tools (Google, Bing, etc.): subdirectories are tracked automatically, while you need additional setup in order to track subdomains.
Another important consideration to make is site security. As the use of SSL encryption gets more and more common, it becomes also a major concern, when planning to expand your site with a subdivision. SSL certificates can in most cases be used on a single domain or subdomain, meaning that you cannot use the SSL certificate of your domain to encrypt any subdomains you create. Worst case scenario, this can result in your site being marked as untrusted by browsers due to a certificate misconfiguration.
The solution here is to purchase a wild card SSL certificate, covering both one or multiple domains and their subdomains. These are though quite expensive.
Alternatively, you can choose to use subdirectories. When using subdirectories, you don’t need to worry about the SSL certificate’s configuration, as they are by default covered by the domain’s SSL certificate.
To sum up, subdirectories are the easy and cheap choice, while subdomains require advanced setup and additional expenses.
When to Use Subdomains and Subdirectories
While there’re no rules that can be applied to all, here’re some tips about when it makes most sense to use subdomains and when subdirectories:
- If your site has already some subdivisions in form of subdomains or subdirectories, it makes most business sense to continue following your current model (for coherence reasons). If, however, your current model seems to not work as expected, you might want to try and experiment with other options.
- Typically, permanent site additions, such as a blog or forum, are best served from a subdirectory. This helps boost brand awareness, as well as SEO.
- Temporary site additions, such as a campaign page, product launch or survey, are best served from a subdomain. This makes it easier to “painlessly” remove the content, once it isn’t used any more.
- If using a (not-wild-card) SSL certificate, you should use subdirectories to avoid errors.
- If you want your new site division to benefit from the SEO-profile of your main site (or vice versa), it is recommended to use subdirectories.
- If you aren’t able to tweak code to, for example, set your cookies or edit tracking code, you are better off using subdirectories.
- If you offer your users the possibility to publish content in their own spaces, something like WordPress.com, it’s best to expand your site with subdomains. This is the best way to signal that the user generated content should be treated as separate hosts.