# How do absolute links work?

**URL:** <https://discuss.ipfs.tech/t/how-do-absolute-links-work/5267>\
**Category:** Help\
**Created:** [April 21, 2019, 1:34am UTC](https://discuss.ipfs.tech/t/how-do-absolute-links-work/5267 "2019-04-21T01:34:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tmcw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/tmcw/32/2312_2.png) [@tmcw](https://discuss.ipfs.tech/u/tmcw)\
**Post date:** [April 22, 2019, 5:08am UTC](https://discuss.ipfs.tech/t/how-do-absolute-links-work/5267/3 "2019-04-22T05:08:10Z")

</div>

> I’d be curious to hear what absolute links offer that relative links don’t for linking within the same website.

Sure, so let’s say that you’re using Jekyll. You write a post. People read that post both on the front page (`/`) and some permalink (`/2019/04/01/hi.html`). From that post, you link to some other post.

Do you link with `../../../foo.html`, because you expect it to be accessed from the permalink, or do you omit all the backtracking, because you expect it to be from the front page? This is the essence, essentially: when you’re writing your content, you don’t know where it is.

This idea extends to resources. The post has some CSS dependency. Does the `<link>` element reference `../../../`? Or not? This is why pretty much all the websites on the internet use paths with `/`. Hit up boingboing, or metafilter, or kottke, or wherever: they all use absolute links that start with either the full path, or `/`.

Now, you’re right - Hugo has a relativeURLs option. Jekyll, the tool I use, doesn’t, and WordPress doesn’t, out of the box, [and has quite a lot of discourse on the pros/cons](https://core.trac.wordpress.org/ticket/17048). It looks like [gatsby implemented a plugin just for ipfs](https://github.com/moxystudio/gatsby-plugin-ipfs) to make URLs relative.

Hopefully this makes it a bit clearer why requiring relative URLs is a problem. I could write a bunch of code to rewrite all the URLs on my site to point to each other, but when I write a post about how I made my website work on IPFS and how _you can too_, I can’t say with a straight face that it’s reasonable if it requires that kind of hack.

---

_[View the full topic](https://discuss.ipfs.tech/t/how-do-absolute-links-work/5267)._
