Have you ever been on a website before, and noticed in the address bar that the simple little www.example.com you’ve typed in turned into something very long and complicated, full of questions marks and equal signs? URLs (i.e. the address of the page you’re viewing) can be pretty darn complicated, but fear not! This is a super-simple guide to understanding a URL’s structure, broken down in a format that’s easy to understand.
Here’s a sample URL that we’ll dissect below:
To see what’s going on in this URL above, here are the various parts, broken down into pieces:
http:// —> This is the protocol. Other protocols include, but are not limited to, ftp://, https://, git://, webcal://, and even gopher://, etc. This is the very first part of the URL.
www. —> This is the subdomain. You can have just about anything imaginable for a subdomain, including www., secure., www2., mail., blog., webmail., etc. You can also choose not to have a subdomain at all (a lot of websites on the Internet don’t have any subdomain at all, in which case, this is skipped).
example.com —> This is the domain name or what’s sometimes called the host. Everything after the host is optional, depending on the configuration of the server configured to respond to the URL. Domain names can be obtained from a domain registrar such as GoDaddy and often end in .com, .org, .net, .info, etc.
:80 —> This is the port. It’s rarely seen in URLs intended for the general public or average user. It is always a number starting with a colon and is placed after the host. Example: websites using SSL (secure sockets layer) security often use port :443 for secure web browsing.
/products/search —> This is the path. Paths are determined by the directory structure of a web server.
?q=1&456=true&will=loves+me+some+jello —> This is the query string. Query strings are indicated with a question mark, and come after the path.
Our example URL has three query parameters in it (the q, the 456, and the word will). Each parameter generally has a value (or multiple values) indicated by the equal sign (which, in this case are: 1, true, and loves+me+some+jello). Multiple parameters are separated with ampersands.
To clarify visually, here’s the list of the three query parameters (on the left of the equal signs) and their respective values (on the right):
q = 1
456 = true
will = loves+me+some+jello
I hope that’s helpful! Happy surfing! (Note: this blog post made possible with the help of my friend Will Clark).