Skip to content

Anatomy of a URL

Wesley Branton edited this page Jun 14, 2020 · 1 revision

This wiki page will help you to understand the various parts that make up a website URL. Each part will be outlined and described in the various sections of this page.

But first, it's helpful to know what a website URL actually is. The URL specifies the location of a page on a website. It appears in the Firefox address bar, which can be found at the top of your Firefox browser.

On this page, the website URL of this page will be broken down and each part will be explained. The URL of this page is https://github.com/WesleyBranton/Website-Blocker/wiki/Anatomy-of-a-URL.

Protocol

In this example, it is the https:// part of the URL. This part of the URL simply tells the browser what type of connection is being made. In most cases, you will only be using http or https (a secure version of http). However, there are other protocols, like ftp or sftp for transferring files.

In the Website Blocker add-on it is not required to specify what protocol will be blocked for a specific website (unless you are creating a fully custom rule). It is assumed that you want all connection types to the website blocked.

Domain

In this example, it is the github.com part. This is the website that you are connecting to. In this case, you are connecting to GitHub's services to view this page. A single domain may have multiple websites attached to it (see Subdomain(s) below).

Subdomain(s)

There is no subdomain specified in this example. However, we can look at a different example for this case. Let's look at https://www.mozilla.org, for example. In this example, the domain is mozilla.org and the subdomain is www.

A subdomain is essentially another website that's attached to the same same domain. For example, Mozilla also owns support.mozilla.org, which is the support website that's attached to the mozilla.org domain.

Although it's not common, it's possible to have multiple subdomains in a single URL. For example, contact.support.example.com is the contact subdomain of the support subdomain of the example.com domain. Each subdomain is separated with a dot.

Path

In the original example of this page's URL, the path is WesleyBranton/Website-Blocker/wiki/Anatomy-of-a-URL. This part of the URL simply tells the browser what page on the website you are loading.

In this case, Firefox has accessed the github.com website and asked to view my account. On my account, it's accessing the Website Blocker add-on page. On the add-on page, it's accessing the help Wiki. In the help Wiki, it has loaded this specific document.

Each part of the path is separated with a slash.

The path is exactly like the folder structure on your computer. For example, to view your downloads, you will probably go to the following path on your computer C:\Users\YOUR_USERNAME\Downloads.

In some cases, a path may end with a specific file. For example, /example/download/list.pdf.

Parameters and Fragments

In the context of the Website Blocker add-on, parameters and fragments will only matter for advanced users that want to block a website only under a specific circumstance. This is not common.

A parameter is extra data that's provided to the website server. It's located at the end of a website URL and starts with a question mark. For example, to watch a YouTube video, the website URL would look like this: https://www.youtube.com/watch?v=SOME_ID. In this situation, the browser has loaded a generic watch page from the youtube.com website and has sent the website server the ID of a specific video. The website server will use the value, when it sends Firefox a copy of the page, to make sure that the correct video is added to the page.

A fragment indicates a specific part of a page. It appears at the end of a URL (after the parameter, if there is one) and starts with a number sign. Generally, this feature is used to have the Firefox browser automatically scroll down to a specific part of the page when the page loads. For example, you could add the #domain fragment to the end of the URL for this page and Firefox will scroll to the Domain section above.