NoipFraud

Absolute vs Relative Links

#problems

When building web pages for NoIPFraud, it is essential to use absolute links instead of relative links when using non-redirect deployment methods.

NoIPFraud relies on absolute links to ensure that all resources and navigation work correctly.

Using relative links can lead to broken links and malfunctioning features, compromising the reliability and functionality of the website.

Definition

An absolute link provides the complete URL (Uniform Resource Locator) needed to reach a specific resource. It includes the protocol (such as http:// or https://), the domain name, and the path to the resource.

Example

<a href="https://en.wikipedia.org/wiki/URL">What is an URL?</a>

Vs

Definition

A relative link provides a path to a resource relative to the current document’s location. It does not include the domain name or the protocol.

Example

<a href="/blog/">Our Blog</a>
<a href="index.html">This Page</a>

⚠️ To prevent broken links or images/styles not loading!

Using relative links will cause broken links due to the change of location of the folder/file when using a non-redirect deployment method .

Absolute links ensure that all resources are consistently accessible, regardless of where the link is used within the site.

Linking to an Internal Page

Here is an example of absolute link to the URL page on en.wikipedia.org

<a href="https://en.wikipedia.org/wiki/URL">About URLs</a>

Referencing an Image, like favicon

Here is an example of using a absolute href for the en.wikepedia.org favicon icon.

<link rel="icon" href="https://en.wikipedia.org/static/favicon/wikipedia.ico">

Referencing a Stylesheet

In this example the page on developer.mozilla.org uses an absolute link to its stylesheet.

<link rel="stylesheet" href="https://developer.mozilla.org/static/css/main.7778d54c.css">

Including a Script

In this example the page on developer.mozilla.org uses an absolute src for javascript.

<script src="https://developer.mozilla.org/static/js/gtag.js" defer=""></script>
← Back to Support