Understanding URLs: Subdomains

This and the other “Deck” posts are a repurposing of flashcard study decks to Q&A blog posts.

What is a subdomain?

It is a prepended string that is added before the domain of a URL example: blog(subdomain).devdecks.io(domain).

What might you use subdomains for in a web application?

Subdomains are used as identifiers within an application often to differentiate between separate functions of an application or organizations. Separating by organization will most often be done in a B2B application eg: fedex.procurementsaasapp.com or forum.procurementsaasapp.com. There can also be multiple if needed: fedex.forum.procurementsaasapp.com.

What is a wildcard subdomain?

This is a DNS CName record with your hosting provider that points all traffic coming in from a subdomain to the root domain for example if there were wildcard subdomains enabled for devdecks.io, then both blog.devdecks.io, and jobs.devdecks.io would point to devdecks.io.

When is it more appropriate to use a URL path instead of a subdomain?

You will want to use a URL path (domain.com/url/path) instead of a subdomain (subdomain.domain.com) when the resource is specific to the business function of your main application. Subdomains are used to identify very different functions from the core application or for different organizations accessing your application.

What is a non wildcard subdomain?

Here you would add a DNS CNAME record with your hosting provider for each subdomain you needed. In this case blog.devdecks and jobs.devdecks would have their own CNAME record, all other subdomains would not be recognized by the server.