When adding a new section of content to your website, you can place it either on a subdomain or in a subdirectory. Both subdomains and subdirectories allow webmasters to optimize their website’s navigation so that visitors can find relevant content more easily. With that said, subdomains aren’t the same as subdirectories. To determine which one is right for your website, you must understand the nuances between them and how choosing the right one can make your SEO campaign a success.
What Is a Subdomain?
A subdomain is a separate website entity that’s part of an existing website’s domain. You can create dozens or hundreds of subdomains for your website, depending on the limitations of your web hosting service. Each subdomain is placed in a separate folder in your website’s root folder and acts almost like an entirely new website. Even if you have a content management system (CMS) like WordPress already installed on your website, you can install a second CMS on a subdomain.
The official HubSpot blog, for example, is located on a subdomain at blog.hubspot.com. In this URL, “.com” is the top-level domain; “hubspot” is the second-level domain, and “blog” is the subdomain. The subdomain, if present, is always preceded by the top-level domain and second-level domain.
What Is a Subdirectory?
Also known as a subfolder, a subdirectory is simply a folder that’s used for navigation purposes on a website. Subdirectories are used to create hierarchical navigation, which is appealing to both visitors and search engines. Like subdomains, subdirectories consist of folders in a website’s root folder in which files like web pages and images are stored.
In the URL hubspot.com/products/get-started, “products” is a subdirectory. Any web pages published under the “products” subdirectory will have a URL that’s prefixed with “hubspot.com/products.”
What’s the Difference?
Because they both consist of folders placed in a website’s root folder, you may assume subdomains and subdirectories are the same. Only subdomains, however, are treated like separate website entities. Any changes you make to your main website won’t affect your subdomain or vice versa.
More importantly, search engines treat subdomains as separate websites. If you create a new subdomain, it probably won’t rank high in the search results — not without extensive SEO like link building and on-page optimization, at least. If you create a subdirectory, on the other hand, any web pages published in the subdirectory should have similar search rankings as the rest of your website.
Several years ago, Moz CEO Rand Fishkin moved an SEO guides section of moz.com from a subdomain to a subdirectory. According to Fishkin, the transition resulted in higher search rankings on Google for the company’s target keywords. If you’re unsure of which to use for your website, we suggest hiring an SEO consultant to assist in making this important decision.
When to Use a Subdomain
There are many instances in which you should use a subdomain. If you’re creating a separate mobile-friendly version of your website, for instance, you can place it on a subdomain rather than trying to upgrade your site to a responsive design. The subdomain’s folder offers a blank palette with which you can build a mobile-friendly version of your website. You can install a new CMS in the subdomain’s folder and configure it to achieve cross-device compatibility.
You can also subdomains for geotargeting purposes. If you run a popular website that’s accessed by residents in several countries, consider creating a subdomain for these countries. On each subdomain, create a country-specific version of your website, such as australia.example.com and canada.example.com, using the appropriate language.
Whether it’s a blog, forum or an “about us” page, you can place any section of your website on a subdomain. A subdomain is nothing more than a folder that’s treated as a separate website entity. It can have its own CMS and traffic analytics software like Google Analytics.
To create a subdomain, access your website’s back-end control panel and look for an option to add a subdomain. In cPanel, you should see an icon titled “Subdomains” under the “Domains” section. Clicking this icon allows you to create a subdomain under your website’s current domain. When finished, you can find the subdomain in your website’s root folder.
When to Use a Subdirectory
You should use subdirectories to create a deeper level of navigation with your website while preserving its authority and, therefore, its search rankings. While subdomains receive some authority from the parent website on which they are created, search engines generally treat them as separate websites. If you use a subdirectory, though, any pages or content published in the subdirectory’s folder will receive the same authority as your website, making subdirectories beneficial for search engine optimization (SEO).
Subdirectories also allow for longer and more descriptive URL slugs. Without subdirectories, you’ll have to place all your site’s web pages in the root folder, resulting in short URL slugs. By placing web pages in subdirectories, you’ll increase the relevancy of their URL slugs.
Subdirectories are particularly useful for e-commerce websites because of their ability to segment product categories. If you run an e-commerce website, you can create a subdirectory for each product category, such as example.com/shirts, example.com/pants, and example.com/shoes. You can then publish or move your site’s product pages in the appropriate subdirectory.
Keep in mind, WordPress and other CMSs may automatically create subdirectories for navigation elements like tags, categories, and authors. If your website doesn’t use a CMS, you can create subdirectories manually using a File Transfer Protocol (FTP) program. After connecting to your website’s server, create a new folder under the root or home directory. This folder will act as a subdirectory, allowing you to segment your website’s content and create navigation-friendly URLs. Just remember to give the folder a relevant name, as this name is reflected in the URL slugs of all web pages placed inside the folder.
Both subdirectories and subdomains are separate sections of a website. The primary difference is that subdomains are treated as a separate website entity, whereas subdirectories are not. As a result, SEO is more difficult with subdomains than subdirectories. If you’re trying to create a new section on your website while preserving its search rankings, use a subdirectory instead.