Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 2.05 KB

redirect.md

File metadata and controls

30 lines (23 loc) · 2.05 KB
date tags
2021-03-17
dev

Redirecting

While working on my #[[api]], I figured out a way to set up a system of dynamic redirects with alias matching. This means I can define multiple links that all redirect to a specific URL, for example /instagram, /ig and /insta all redirect to my instagram profile. The advantage of this is that I don't have to remember a specific term, any other synonym I defined will work too.

This was made possible by setting up a second domain (muensterer.link), that forwards requests to the /redirect route of my [[api]]. I also modified the 404 page on my homepage to automatically attempt a redirect if the page does not exist.

It even passes on the rest of the URL, so instead of going https://github.com/dnnsmnstrr/dotfiles I can just type muensterer.link/gh/dotfiles. This "autoexpansion" of URL components has proven to be very useful.

There are different ways to access these redirects:

Ideas

  • check for fallbacks in projects and notes (Github API)

Links