05. URLs

Before we look at how we apply links, let's find out what URL's are, and how they work.

Uniform Resource Locators

URL stands for Uniform Resource Locator, which is just a fancy name for an address. Each file on the Internet has a unique URL.

Let's take a look at an example URL:

A Sample URL

There are three main parts to this web address: the scheme, host name and path.

1) Scheme

The first part of a URL is the scheme. Here, it would be the "http://", which stands for Hypertext Transfer Protocol. This is used to access webpages. Another scheme you may have heard of is "https://", which is similar, but for secured connections.

Other schemes include "ftp://", which stands for File Transfer Protocol and is used to download files, while "mailto" is for sending emails.

2) Host Name

The second part is the host name, "www.somesite.com". This directs the user to the server where the webpage is hosted.

3) Path

Next you have your path. Most often this means a path to a specific folder. For example here, we have "file.html" that can be found inside the "folder" directory.

Note that the path does not necessarily have to be a filepath, but could be the developers implementing a pretty-URL. This is a more advanced concept that is handled by a back-end server framework.

Great! Now let's learn how to apply a URL on an HTML page.

Build modern and responsive webpages

JavaScript & JQuery

Build modern and responsive webpages Try Front-end

This book was written for anyone who wants to use JavaScript to make their websites a little more interesting, engaging, interactive, or usable. In particular, it is aimed at people who do not have a degree in computer science (well, not yet anyway).

$ Check price
39.9939.99Amazon 4.5 logo(385+ reviews)

More Front-end resources

Aching back from coding all day?

Self-Massage Tool

Aching back from coding all day? Try Back Problems

Relieve spasms, tight muscles, trigger points and pressure points with the Body Back Buddy! This trigger point massage is designed to help you self-message any area of your body - especially those that are hard to reach. Keeping your muscles relaxes and out of contraction is importan in helping to reduce pain and prevent muscle injury.

$ Check price
29.9529.95Amazon 4.5 logo(3,443+ reviews)

More Back Problems resources

Ad