Absolute and Relative URLs

(Using non-technical, Neocities-specific terms).

There are two types of links: absolute and relative.

Absolute links are simple. It’s an entire web address.

<a href=”https://crouton.net/”>

Relative links are based on the address you’re currently on.

Say I wanted to go to my themes page. We’re currently inside the "misc" folder, which themes isn't in, so a link like this…

<a href=”themes”> Will actually take me to "misc/themes", which is nothing.

To link back to a page outside of the folder, add a forward slash in front of the link.

<a href=”/themes”> And we’ll get what we want .

But if I wanted to go to another page that’s in the same folder, I'd be fine without the forward slash.

<a href=”croutons”>

The forward slash indicates that we want to “reset” the website back to its beginning point, also known as the index. So rather than use “misc/” as the starting point, it will use "/".

Thus, if you want to link back to your index page, just do:

<a href=”/”>

Final Notes: If you’re wondering why “index.html” is a website’s starting page, it’s because you can’t name a file nothing.

Additionally, a folder can have an “index.html” inside of it, and it will act as if it's named the folder name. So if you have a folder named “croutons” and have “index.html” in it, “/croutons” will redirect to that “index.html”.

Further Reading