Being a good web developer requires you to know as much about how the internet works as possible. And one common term you’ll need to know about is a URL.

What exactly is a URL? Is it the same as a domain name?

Short answer: nope, there’s a difference.

Longer answer: A domain name is part of a URL, which stands for Uniform Resource Locator. A typical URL looks like this: http://www.example.com/index.html, which indicates a protocol ( http ), a hostname ( www.example.com ), and a file name  ( index.html ).  


Let me explain more


In order for browsers and servers to “talk to one another,” computers rely on a language made up of numbers and letters called an IP address. Every device that connects to the internet has a unique IP address and looks something like this: 22.231.115.64.

In order to navigate easily around the web, typing in a long IP address isn’t practical. And this is why domain names were created – to hide IP addresses with something more memorable. You could consider the domain name as a “nickname” to the IP address.

When it comes to a URL, a URL incorporates the domain name, along with other detailed information, to create a complete address to take the browser to a specific page online called a web page.


What does this have to do with forms? 


When a form is submitted, it can either be done via a GET request, or a POST request. With a GET request, the data in the form is appended to the URL in a query string.  And for this reason alone, its important for you to know what a URL is and how they work.

Hope this is all starting to make sense.

Don't worry if you're still a little confused. We are going to be talking more about all of this in the upcoming lectures.

Let's march on ;)

p.s. there is also a URI, which stands for Uniform Resource Identifier. Don’t worry too much about the differences between a URI and URL. Just know that a URI is the king of identifying resources. All URLs are a subset of URIs. So what are the differences then? Well, the most obvious is that a URL is used to locate only web pages, but a URI can be used with HTML, XML and other things. A URI can even be used to identify a book like this: urn:isbn:0-412-41478-4.