Explaining the Default URL Structure

When we’re talking about a URL (Universal Resource Locator), we’re typically referring to the line of text that you see in your browser’s address bar. A URL is a subset of something we call a URI, but in this article, we’ll only focus on the default structure of a URL.

The first thing you’ll notice in a URL is the protocol or scheme. In most cases, this will either be https:// or http://. Though there exists a whole array of other schemes.

The second will be your domain or subdomain. This is what identifies your site, and if you’re using a subdomain before your domain they will be separated by a period. www is an example of a type of subdomain.

HTTPS://sub.domain.tld

The last part is what we call the top-level domain (TLD). This can be .com, .org and even .pizza for example. It was originally created to ease of remembering with it describing geographically where the site is and the type of site you wanted to visit. .com standing for Commercial Business, .org standing for Organisation, .th standing for Thailand and so on.

All of this is what we would call the base URL. What comes after that is what we call the relative URL

https://sub.domain.tld/relative/path/

We can divide the relative URL into two parts. The first part comes right after the top-level domain and ends at the second-to-last front slash. This denotes the directory path to where you are. This is called the prefix URL

The other part is the last string in the prefix URL which we can call the entry-specific URL. This will be the last section, /path/ in our URL example above which comes after the prefix URL. This tells you where you’re currently on the website.


The last part we will touch upon is when you see a question mark followed by some text. This is something we call the query string. This can be used to gather information from the user if they submit a form on your site, for example. Query strings can be chained together with the & symbol.

https://sub.domain.tld/relative/path/?query=string
Breakdown of the full URL structure

Breakdown

  • Absolute URL: https://www.example.com/path/to/my/blog/?fname=John&lname=Smith
    • Base URL: https://www.example.com
      • Protocol/scheme: https://
      • Sub-domain: www
      • Domain: example
      • Top-level domain: com
    • Relative URL: /path/to/my/blog/
      • Prefix URL: /path/to/my
      • Entry-specific URL: /blog/
    • Query string: ?fname=John&lname=Smith

Be aware that this is only one naming structure and others might use other definitions. Some call query parameters for query strings for example.


And as always, should you have any additional questions please don’t hesitate to contact our support chat at servebolt.com!