Think of the World Wide Web as a vast collection of electronic files stored on millions of computers all around the world. Hypertext links these files together. Uniform Resource Locators or URLs are the addresses used to locate the files.
The information contained in a URL gives you the ability to hop from one web page to another with just a click of the mouse. When you type a URL into your browser or click a hypertext link, your browser sends a request to a remote computer, called a web server, to download one or more files. Every URL is unique, identifying one specific file.
What does a typical URL look like? Here are a few examples:
- The home page of Learn the Net.
- The Facebook page for Learn the Net.
- A directory of files at MIT available for downloading.
- A blog about soccer from the Reuters news service.
Let's deconstruct a nasty looking web address:
The first part of a URL (before the two slashes) is called the protocol. It tells the browser the type of resource or method of access at that address. For example:
- a hypertext document or directory
- a file available for downloading or a directory of these files
- a file located on a local drive of your computer
In our example, the protocol is “http.”
You will often see another protocol, “https.” This is a kind of secure and encrypted http protocol. It was originally designed for things like credit card processing. But it is used much more widely than that today. Wikipedia uses https for three reasons:
- It provides protection against eavesdropping.
- It has better error detection for people with bad internet connections.
- It stops internet access points from injecting banner ads.
The second part is the address of the website where the data or service is located. In our example, the website is Gibberish.com. Often, the web address ends there. Your browser knows to take you to the homepage of the website. But usually, it's a bit more complicated than that.
After the website, comes the location of the file on the website. And in many cases, this file is many directories (or folders) deep. In our example, the file unreadable.php is in the almost directory in the base directory of the site: /almost/unreadable.php.
Query Strings and Hashtags
Now we get to the fun stuff that makes webpage addresses look really weird — like the digital equivalent of witchcraft. Some of it is important to you, but most of it is just internal stuff. The question mark signals to the browser that the webpage has been determined by the stuff that went before. After it, comes the query strings. These are usually things like “x=something” and they are separated by the ampersand (&) character. Sometimes there are dozens of them.
Most modern browsers will allow you to enter a URL or search terms in the address bar.
Finally, the hashtag (#) just tells the webpage where to position itself. It is most often used when only part of a page is displayed (like on the front page of a blog where the beginnings of a number of articles are listed). When the user clicks a link like “Read more” a new page loads and positions itself to where you left off reading. If you click this link it will take you to the “Details of Web Addresses” section above. Look at how the web address changes.
Using Web Addresses
You enter the URL of a site or webpage by typing it into the address bar of your web browser. But be careful! New browsers also allow you to enter search terms into the address bar. The browsers are pretty good at figuring out what you are trying to do. But sometimes they mess up. Don't let it confuse you.
Browsers can store the URLs you want to revisit by adding them to a special list. Chrome, Firefox, and Safari all call them Bookmarks; Internet Explorer calls them Favorites. Once you add a URL to your list, you can return to that web page by clicking the name on the list, instead of retyping the address — a good thing, as some URLs can be quite long.
Most of the URLs you will use start with http, which stands for Hypertext Transfer Protocol, the method by which HTML files are transferred over the Web. In fact, they are so common, that browsers just assume that you mean it when you don't use anything. So entering “Gibberish.com” is the same as entering “http://www.Gibberish.com.” Here are few other things to know about URLs:
- A URL usually has no spaces. (When it does, it uses the computer code for a space character, “%20.”
- A URL always uses forward slashes (//).
- URLs are case sensitive, but protocols and website names are not. So typing “http://www.Gibberish.com” or “HTTP://WWW.GIBBERISH.COM” or any variation of upper and lower case letters takes you to the same website. But the following will almost certainly fail to load the page you want:
- If you type a URL incorrectly, your browser will not be able to locate the site or resource you want. Should you get an error message or access the wrong site, check to see if you spelled the address correctly.
- You can find the URL behind any hyperlink by placing your cursor over the link. The URL appears in your browser's status bar, usually located at the bottom of your browser window.
- It is often convenient to open a link in a new tab or window. You can do this by right-clicking on the link. This will cause a menu to appear and you can select what you want to do from it.
To learn more about URLs, read the World Wide Web Consortium's Fact Sheet on URLs.