What Is a URL, Exactly?

You’ve heard the term “URL” many times. Now, you want to know what it really means.

Published Categorized as Web & Code

The term “URL” stands for “Uniform Resource Locator.” URLs are also called links, hyperlinks, or web addresses.

A URL is the location of a resource—whether that’s a web page, an image, an audio file, a video file, or any other uniquely identifiable digital asset—on the Internet.

Just like Google Maps can only take you somewhere only if you know the exact address, your browser can only open a web page or download a file if you know its full URL.

The Parts of a URL

Every URL consists of several parts. Together, these parts point to the exact location of the resource in question.

The different parts of a URL address

A properly formatted URL can be broken into seven parts:

  • The protocol (also called “scheme”)
  • The subdomain
  • The domain name (either gTLD or ccTLD)
  • The port number
  • The page path
  • The query (also called “search query” or “URL parameters”)
  • The fragment

The required parts of a URL are the protocol and the domain name. Optionally, a URL can also have a subdomain, port number, page path, query string, and fragment.

Generally, URLs are used for websites, their web pages, as well as the media files and scripts on them via the HTTP and HTTPS protocols.

Not everyone knows that URLs have other uses on the web. For example, URLs are also used for file transfer (via the FTP and SFTP protocols) and email exchange (via the SMTP protocol).

For example, the address sftp://192.168.0.1/folder/sample-file.extension is the URL of a file hosted on an SFTP server. And smtp://user:host@example.com:port is the URL of an email account on an SMTP email server.

Can a URL Have Numbers?

Yes, a URL can contain the digits 0 to 9, and they can make up any number.

You can insert numbers in any of the main parts of a URL (namely, the subdomain, domain, page path, query, and fragment), and you can combine them with text and special characters.

Can a URL Have Special Characters?

According to RFC 1738, the official specification for URLs, the main parts of a URL can consist of the lowercase letters “a” to “z,” the digits 0 through 9, and the characters plus (“+”), period (“.”), and hyphen (“-“).

Developers can also reserve the semicolon “;”, forward slash “/”, question mark “?”, colon “:”, at symbol “@”, equals sign “=” and ampersand “&” are the characters which may be reserved for special meaning within the URL.

No other characters, the RFC specification states, may be used within the URL. (And yet, in recent years, the hash character (“#”) was introduced as the fragment identifier.)

Can You Use Emojis in a URL?

Emojis are everywhere these days! But have you ever wondered if you can put them in the URL of a web page?

It turns out that you can indeed put emojis in any part of a URL (other than the protocol), whether that’s the subdomain, the domain name, the page path, or the parameters.

Wondering how this works?

When a user types a URL with an emoji in the address bar of their web browser, it’s converted to Punycode, a subset of the ASCII character set used for Internet hostnames. (You can see how this works at punycoder.com.)

For example, the red heart emoji (❤️) is converted to xn--qei, and that’s the string the web browser uses to perform the DNS lookup.

Can a URL Be in Other Languages?

Here’s an interesting question for you: If your website is aimed at non-English visitors, can you use a language other than English in the URLs?

To give you the long answer short, yes, you can use non-English characters and words in your site’s URL if it’s aimed at non-English visitors. Keep in mind that for domain names, non-Latin characters are represented in Punycode, a subset of the ASCII character set.

But don’t just take my word for it. As Google Search’s John Mueller explains in this YouTube video, “Yes, non-English words in URLs are fine. We recommend using them for non-English websites.”

Read up on the topic at Search Engine Land to understand whether and how these characters can affect your website’s SEO.

Can a URL Be an IP Address?

Most websites on the Internet have a domain name or subdomain name in their URL. But not everyone knows that, instead of the domain name a website can also have an IP address in its URL.

This IP address is the network address of the web server hosting the website. Domains and subdomains are simply easier-to-remember addresses that point to the same place.

Web developers are used to working on sites with IP addresses in their URLs because it doesn’t make sense to let a work-in-progress site go live on a domain name before it’s considered finished.

URI vs. URL

URI stands for “Uniform Resource Identifier” and refers to any type of unique name that can be used to identify an object. For example, the bar code on a can of corn in the supermarket is a URI, and so is the ISBN number of a book in the bookstore.

URL, on the other hand, stands for “Uniform Resource Locator.” It’s basically a type of URI created specifically for web pages published on the Internet.

Link vs. URL

The URL is the full and exact location of a given resource on the Internet. A link, on the other hand, can either be the same as the URL or contain the part of the URL that starts with the page path and optionally includes the query and/or fragment.

Say that an HTML document is hosted at https://example.com/blog/post-01.html.

If the author of the website wanted to link from its homepage to this blog post, they can do so with a relative link:

<a href="/blog/post-01.html">Blog Post 01</a>

A relative link is a link that only includes the page path, query, and/or fragment—leaving out the domain name, subdomain, and protocol.

However, if other websites want to link to that same blog post, they would have to create absolute links:

<a href="https://example.com/blog/post-01.html">Blog Post 01</a>

An absolute link is a link that contains the full URL of the web page or resource it points to.

WWW vs. URL

The abbreviation “WWW” stands for the “World Wide Web.”

The “www” subdomain is simply a part of the URL address. And “www” is one of the many subdomains that a domain name can have.

Contrary to what some people think, the “www” subdomain serves no practical or technical purpose.

A website may or may not have “www” in the beginning of its URL—apart from the fact that it makes that URL longer, it won’t necessarily make a difference.

In the past, many website owners placed the publicly accessible pages of their websites (for example, the homepage, about page, contacts page, and so on) on the “www” subdomain of their domain name.

By Dim Nikov

Editor of Maker's Aid. Part programmer, part marketer. Making things on the web and helping others do the same since the 2000s. Yes, I had Friendster and Myspace.

Leave a comment

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