Subdomain and subdirectory vary and there may be some confusion at first on how they work, or how they differ. We will look at the differences and how we can create an subdomain and a sub directory for our domain name.
We will be using the domain of “mysuperweb.co.uk”
A subdomain is something you add to the domain name in the beginning, as our domain name is mysuperweb.co.uk, we can look to create a subdomain name of “https://shop.mysuperweb.co.uk”, this is to assume we would be selling something online. When visitors visit the website, they will see the phrase shop and they will associate it with an purchase or transaction which will exist within the subdomain. The main advantage of the subdomain is it allows you to isolate it from your main website and to also specify a different server for each subdomain you have.
A subdirectory is something you add to the domain name at the end, as we have our subdomain already of “https://shop.mysuperweb.co.uk” visitors know its an shopping area. For our shop we can be selling many product, through the use of subdirectory we can separate the products to different categories. We can have https://shop.mysuperweb.co.uk/toys, in this instance toys will be the subdirectory. Normally the subdirectory will reside within the same server.