What Is a Subdomain? A Beginner’s Guide

What Is a Subdomain?

A subdomain is an extension of your domain that helps you organize content and expand your business offerings. It allows you to create standalone pages or functions, such as a blog or online store. This website has a few subdomains. One of them is beta.amgsites.co.uk. Click on the link to view the website. It is a WordPress Beta site I use to see what changes are being made for upcoming future releases of WordPress. My other subdomain sites are for future projects I am working on like demo.amgsites.co.uk which will be a WordPress demo site running on my server.

Understanding URL Structure

Your URL has several parts. The protocol (HTTP or HTTPS) comes before the subdomain. This is the file path that transfers data from a web server to your browser so it can load the website. The root domain comes after the subdomain. It’s made up of two parts: The second-level domain (SLD) is the name of your website (typically your brand or business name) The most common subdomain is “www” or “World Wide Web.” The subdirectory points users to the main directory of a website where your homepage and other core pages live. Other subdomains work to create distinct parts of a site. For example, Google’s root domain is www.google.com. This is the address people type into a browser search bar to access Google search. Over time, Google has grown to include a full suite of products independent of its search engine. To keep these separate, Google uses subdomains such as docs.google.com for Google Docs and adsense.google.com for Google Ads. Using subdomains keeps Google’s search engine free from the distraction of other products. The lack of links and unrelated content lets Google focus visitors’ attention on search, which is ultimately what they are there for. Subdomains create a separate identity and provide an opportunity to create a unique website within a website. For example, Google Docs and Google Adsense are unique products. A subdomain lets Google use a different design and content structure to create a clear distinction between them (and other products). Google markets subdomains independently while keeping them under the umbrella of the primary domain that users know and trust

Subdomains vs. Subdirectories

Subdomains and subdirectories are both smaller subsets of a root domain that let you organize website content. But there are distinct differences. A subdomain acts as another website that can use a different design or interface from the main domain A subdirectory is a folder that sits inside a domain. Say you run an online pet food store and want to add a blog to give your audience tips on feeding their pets a wholesome diet. You can add your blog as a subdirectory by creating a new page in the same way you do for a product or service. The blog becomes a folder within your primary domain. This means it uses the same design and content management system (CMS) as the rest of your website. When a user clicks through to your blog, the URL will look like this: www.mypetstore.com/blog Now, let’s say your reason for creating a blog is to focus on another area of your business. For example, pet behaviour training. The content is different from what’s on your main site, so it makes sense to keep it separate. Creating a subdomain lets you create a blog on a different CMS (e.g., WordPress) with its interface. Your blog now sits outside of your main domain and the URL looks like this: blog.mypetstore.com A subdomain always sits before the root domain in the URL. A subdirectory always sits after. Another slight difference between the two is how they affect the nested structure of your site. With a subdirectory, you can add subfolders to the main folder that point to different categories. For example, www.mypetstore.com/blog/pets and then www.mypetstore.com/blog/pets/dogs. Because a subdomain acts like a root domain, you can add subdirectories to your subdomain to organize pages. For example, ads.google.com has “home” as a subdirectory. This helps to organize succeeding pages. In this case, “how it works” follows the subdirectory and creates a clear path that flows from the subdomain landing page to the subdirectory to content.

Should You Use a Subdomain or Subdirectory?

Subdomains are best for content that is too distinct from your main website. For example, if the topic has a different purpose or requires a specific CMS or design. The clear separation prevents user confusion and stops you from sending mixed messages to search engines about your content. Subdirectories are best for content that is relevant to your main website. For example, if your website is www.mypetstore.com, it makes sense to place dog food in a subdirectory (e.g., www.mypetstore.com/dog-food) as it fits with the main site. 

When to Use Subdomains

Subdomains give webpages a unique identity while keeping them part of your main website. There are a few instances in which you can benefit from using them:

Creating a Blog

If your target blog topics and keywords don’t relate to the rest of your website, using a subdomain lets you engage visitors with different content. For example, Fiverr’s main website focuses on its marketplace of freelancer services. Its blog is a separate entity that features a variety of topics, such as company news and business tips. Fiverr hosts its blog on a subdomain.

Building a New Website with a Subdomain

If you own a hosting server like me and use a Windows Server operating system then this tutorial is for you. The first thing you need to do is go to your domain provider like Godaddy or if you are running your domain through Cloudflare then you will need to login to the admin interface on their website and add a CNAME to your DNS records so the subdomain will point to your public IP address. If you are not sure how to do that follow the step-by-step tutorial below. Once you have logged into Cloudflares home page select the website you will be working on like in the image below.

Once your have clicked on the website name and are taken to the website page click on DNS like in the image below.

Now click on Add Record and select CNAME in the Type box. Next add a desired name in the Name (required) box like shop, test or beta. Then in the Target (required) box add your public IP address. You can find that by typing my IP address on Google search and you will see a box with What’s my IP and displaying your IP address. Have a look at the two images below for the Cloudflare CNAME and the Public IP address example. When you have finished click Save.

To test if the domain is pointing to your public IP address just open your browser and type test.yourdmain.com in the address bar. If it is active you should see Not Found HTTP Error 404. The requested resource is not found returned from your server as seen in the example below.

What do you do next?

If like me you are using a Windows Server you will have to set up a website on Internet Information Services and I will explain how to do all of that below.

It is the same as setting up a website with one small change. So here we go. Right-click on Site and then click on Add Website as seen in the image below.

Now you want to add all the details in all the boxes making sure the file path is correct for all the files for your WordPress website. If you use an SSL certificate select https and port 443 in the Binding boxes. Select the certificate from your server via the SSL certificate box at the bottom. If you are running your Domain name through Cloudflare and have a certificate with them that Encrypts end-to-end, using a self-signed certificate on the server you should see https://test.yourdomain.com in your browser. However, you will still need one of the server certificates automatically generated by the Windows server. Once you have completed all the steps in the image below, click OK and your website will start.

Now you can open your browser and type the domain like test.amgsites.co.uk like my test site. Yours will be test.yourdomain.com. Your website will appear and you will see the WordPress setup page. Just follow the instructions on that page entering your  Database name, Username and Password and then on the second setup page enter your website name, Username and Login details so they are ready for logging into your website to be taken to your WordPress Admin Page-like test.yourdomain.com/wp-login.php. The image below shows the standard 2024 theme and page used in a new set-up of WordPress and you should look like the image below. 

Not sure what a WordPress Multisite Network is and how it all works and would like to set up a multisite then go to the multisite-setup page and follow the set-up guild on that page.

Scroll to Top