What Is the Difference Between a Relative and Absolute URL?

Every website needs to reference certain resources, whether they’re images, files, or other web pages. Deciding how to link to other files is extremely important to ensure that browsers locate them correctly.

Sign up forfree

Forgot your password?

Create an account

*Required: 8 chars, 1 capital letter, 1 number

By continuing, you agree to thePrivacy PolicyandTerms of Use.You also agree to receive our newsletters, you could opt-out any time.

4

How to Use an Absolute URL Path

An absolute URL contains the entire path to a particular file location. Examples of these include the full path to files on your computer:

Another example includes a full protocol URL, which you can use to identify a resource to send over the internet. Most commonly, these start with “https” or “http”:

A close-up of a web browser showing a URL in the address bar

The absolute URL contains all the information required to locate the file or resource you are attempting to access. This is required if you are linking to an external site.

How to Use a Relative URL Path

A relative URL only stores part of the URL or path, and is usually relative to the location of the current file or section of a website.

In the above example, to accessLogo.icofromindex.htmlusing a relative URL, you would use the path “Images/Icons/Logo.ico”. Other examples include:

article limit background

When you use the same folder structure on another computer, the website will still be able to retrieve the file. When routing over the web, instead of using the full link such as “https://example.com/about", you may use relative routing instead:

You can use a relative URL to create links or reference images inside your HTML web page.

Absolute URL of bird image

Now you can determine the difference between absolute and relative URLs. You can now take extra care to ensure your resources are always retrieved.

You should also always ensure that all links that your users can access are safe and secure.

New photo of bird stored in the file manager

Before clicking any suspicious link, use one of these link checkers to check that it doesn’t lead to malware or other security threats.

Freeing up vital memory on Windows only takes a moment, and your computer will feel much faster once you’re done.

You can’t call this offline, Notion.

Who asked for these upgrades?

You don’t need to fork out for expensive hardware to run an AI on your PC.

I found my TV was always listening—so I shut it down.

Technology Explained

PC & Mobile