What exactly is a URL?

02Apr, 2019

If you have ever used the internet (which you have probably done considering you are reading this post) then, you have almost certainly typed in a Uniform Resource, locator or URL, to get to https://fincoapps.com.

But while some are simple, like LAN, full-length URLs can look awfully confusing. Why do we need things like http, https, ftp, ftps  in there and what are all those ampersands (&), question marks (?) and hash (#)?

Basic components of a URL

Let us demystify the ingredients of your typical web address, starting with the beginning of the scheme

HTTP

The most familiar will probably be HTTP, which stands for Hypertext Transfer Protocol. The set of commands that handles the transmission of Webpages.  But there are other schemes as well. For example, if you have ever Clicked on an email address, you might notice that the link starts with “mailto” (a scheme that tells the browser to open up your default email client).

There is also FTP or File Transfer Protocol, which is used to send….. files to and from remote servers and even IRC, which allows you to connect directly to a chatroom.

Domain Name

The next part of a typical URL is usually a domain name. The name of a website like amazon or microsoft.     This is called a top-level domain or TLD which you can think of as the main categories that sort every website on the Internet and help route your request through several servers to get you to the correct IP address the requested website is located on.  For example in “amazon.com”, amazon is the TLD.  Similarly in “microsoft.com”, microsoft is the TLD.

Domain Extension

The next part of the URL immediately after the Domain Name is the Domain name extension.  Examples of Domain Name extensions include .net, .org, .gov etc.

Typically

  • A .com will indicate a commercial website
  • A .org indicates a nonprofit organization.
  • A .gov would indicate a government website.
  • A .edu would indicate an educational institution website.

Request Path

This is the part that is separated by slashes.  It indicates the past or the specific location of the page or another piece of content on the specific website. Each slash indicates another folder or subfolder (kind of like how files on your computer storage drive are organized).  Note that this explanation does not completely apply to modern web development where concepts like URL rewriting is used to create pretty URLs.

Request Query

As for question marks, these make a URL hard to read, but their existence actually makes a lot of sense. They indicate a query defined by the user. For example, if you type a search into Google, you will see your string in the results page URL after the question mark symbol, which (In the case of Google Search) tells the server to execute that search. If a URL has multiple queries, these will be separated by Ampersands (&), showing that the browser is relaying multiple pieces of information to the website.

Hash (#)

Have you ever clicked a link just to have it, send you somewhere else on the same page. That was probably done through a fragment indicated by a Hash sign(#).  The Hash sign can mark specific spots on a webpage, but can also indicate other things like the folder you are.   It is also used in modern Single Page Web Apps.

Hope this post was informative. If you have any questions or contributions, feel free to post them in the comment box below 🙂 .


Leave a Reply

Your email address will not be published. Required fields are marked *