git.s-ol.nu mmm / 5ea749e
add why_redirectly blog post s-ol 18 days ago
4 changed file(s) with 54 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1 # Why I'm running a personal URL shortening service
2 This blog you are reading at the moment is currently running it's third reincarnation.
3 Originally, it was a Jekyll blog hosted on github pages,
4 before I moved to my own web platform.
5 That platform is currently undergoing its second big rewrite.
6
7 Even while still running on github pages,
8 the blog moved from https://s0lll0s.github.io, to https://s0lll0s.me and finally to https://s-ol.nu.
9 Once arrived at https://s-ol.nu, I had to move the blog posts to a different route (`/blog` vs just living in the root)
10 at some point, to make space for other routes.
11 Then with my custom platform everything changed again,
12 since now my main system is actually located at https://mmm.s-ol.nu.
13
14 As you might imagine, at every change all the old URLs stop working.
15 Noone likes finding dead links, but if you post links on social media
16 it is often extremely unwieldy or impossible to update all the posts.
17
18 If you run your own website or blog ([maybe][sir] you [should][indie]?),
19 your site may have gone throug similar transitions,
20 or maybe it is about to go through one -
21 or perhaps you are deferring making a change because you worry about this?
22
23 To partially solve this issue, I built a tiny URL redirection service, [redirectly][redirectly].
24 It works much the same as those URL shortening services you may have used before (bit.ly, tinyurl etc.),
25 except that I manually specify the shortened URLs in a file (in the git repo).
26
27 Nowadays, when I post a link to some content on my website (such as this blog post),
28 I first allocate a new `slug` (shortlink) and set it up in `redirectly`.
29 Then I use the shortened link, such as https://s-ol.nu/why-redirectly in this case,
30 instead of directly linking to the content.
31
32 This way, whenever I make changes to my content's adressing scheme,
33 I simply change the URL location, and any old links that are floating around remain functional.
34 Should I ever change to another domain, I will consider simply leaving the redirection service running on this domain anyhow,
35 to keep old links alive. At least for a few years :)
36
37 Of course all of this doesn't work when visitors of my page navigate around by themselves,
38 and then share the URL from their address bar.
39 This could be solved by using the JS [history API][history] by overriding the displayed URL with the permalink whenever one exists,
40 but I haven't tried implementing this type of bi-directional querying yet.
41
42 I am also aware that running Clojure (and therefore a JVM) is not necessarily
43 the best choice for a service that is so light,
44 but I wrote `redirectly` as a little experiment while learning Clojure,
45 and it is such a simple project that if it ever bugs me I can just throw it out and implement it in something else.
46
47 [sir]: https://drewdevault.com/make-a-blog
48 [indie]: https://indieweb.org/why
49
50 [redirectly]: https://s-ol.nu/redirectly/src
51 [history]: https://developer.mozilla.org/en-US/docs/Web/API/History_API
1 Why I'm running a personal URL shortening service