Domain vs Subdomain: What's the difference?
What's the difference between a domain and a subdomain?
The difference between a domain and a subdomain is that a domain is the main address used to identify a website or an online entity, while a subdomain is a subset of that domain used to create unique addresses for specific sections or services within the main domain.

What is a domain?
A domain is a user-friendly address identifying a specific location or service online. It comprises a unique combination of letters and numbers, like "example.com." Domains make it easier for people to access websites and other online services without remembering complicated numerical codes. Domains are organised into levels, such as top-level domains (TLDs) like .com, .org, .net, and country-code TLDs like co.uk, .ca, etc.
What is a subdomain?
A subdomain is a smaller part of a larger domain. It categorises and accesses different sections or services within the main domain. Subdomains are created by adding a prefix to the main domain, resulting in addresses like "blog.example.com" or "store.example.com." Each subdomain can function as a separate website or service, having its unique content and features. Subdomains are employed to create distinct web addresses under the same domain name, often used for organisational purposes or to host specific services like blogs, forums, or online stores.
Other parts of a URL
Scheme/Protocol: This indicates the protocol used to access the resource on the Internet. Common schemes include "http," "https," "ftp," "mailto," and "tel." For example, in the URL "https://www.example.com," the scheme is "https."
Subdomain: Subdomains are optional and precede the main domain name in a URL. They are used to organize and navigate to different sections of a website. For instance, in "https://www.example.com," "www" is the subdomain or
Domain Name: The domain name is the human-readable address of the website. In the URL "https://www.example.com," "example" is the domain name.
Top-Level Domain (TLD): The TLD is the last part of the domain name, such as ".com," ".org," ".net," etc. It indicates the type or purpose of the website. In "https://www.example.com," ".com" is the TLD.
Path: The path specifies the specific page or resource on the web server. It comes after the domain name and is separated by slashes ("/"). For example, in the URL "https://www.example.com/page/resource," "/page/resource" is the path.
Query Parameters: Query parameters are used to send data to the web server as part of the URL. They follow a question mark "?" and are typically in the form of key-value pairs separated by "&". For example, in the URL "https://www.example.com/search?q=query," "?q=query" is the query parameter indicating a search for the term "query."
Fragment: The fragment identifier, also known as the hash, points to a specific section within the resource linked by the URL. It follows a hash symbol "#" and is often used in URLs pointing to sections of web pages. For instance, in the URL "https://www.example.com/page#section," "#section" is the fragment identifier indicating a specific page section.







