The idea is to have a dedicated repo with only a _redirects
file in there which you constantly update and push (and thus deploy). To help automate that, Kent C. Dodds create a package named netlify-shortener
which does that for you:
- Generates a short code if one is not provided
- Validates your URL is a real URL
- Adds the URL to the top of _redirects
- Runs a git commit and push (this will trigger netlify to deploy your new redirect)
- Copies the short URL to your clipboard
The video embedded at the top of this post shows you how to implement this (feel free to fast forward to the 10 minute mark)