# Custom short-link redirector

DevFeed: [Custom short-link redirector](<https://devfeed.tech/articles/custom-short-link-redirector-20927.md>)

Original publisher: [Read original article](<https://jakewharton.com/custom-short-link-redirector/>)

Published: 2025-10-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Netlify](<https://devfeed.tech/topics/netlify.md>), [Git](<https://devfeed.tech/topics/git.md>), [hosting](<https://devfeed.tech/topics/hosting.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [HTTP](<https://devfeed.tech/topics/http.md>)

Tags: [dns](<https://devfeed.tech/tags/dns.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [hosting](<https://devfeed.tech/tags/hosting.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [http](<https://devfeed.tech/tags/http.md>), [netlify](<https://devfeed.tech/tags/netlify.md>)

## AI overview

A tutorial explaining how to replace Bit.ly with a custom short-link redirector built on Netlify. It covers storing redirect rules in a Git repository, automatically deploying them through Netlify, configuring a custom domain and DNS, and using HTTP 302 redirects. The solution can be implemented on Netlify's free tier.

## Source excerpt

I used to use Bit.ly to put links into my presentations. Their service allowed you to customize the path portion of the link, so I was able to create links like bit.ly/ok-libs. If you were attending the talks live, watching the recording, or browsing the slides, the short URL was easy to type into a browser. Unfortunately, the path customization of Bit.ly is a global namespace. Short and memorable paths became increasingly hard to find. Ten years ago I bought the jakes.link URL to solve this problem. Bit.ly let you point custom domains at their service, and each then gets its own path namespace without risk of collision. A few months ago bit.ly announced that they would show a preview page with ads before redirecting. Gross. This happens for links on their domain and on custom domains for all free users. I'd be happy to pay a few bucks a year to avoid this, but the cheapest plan which supports custom domains is $350/year (paid annually). That's nothing short of ridiculous for the one or two links per year which I create. Netlify I use Netlify for hosting this site because one of its features is server-side redirects. This ensures that I can keep old URLs working, because a good URL is forever. But it also makes Netlify a great candidate for a build-your-own short-link redirector. Here's how I migrated jakes.link in three steps: Create a git repo with a _redirects file following Netlify's redirect documentation. / https://jakewharton.com 302 /how-to https://jakewharton.com/custom-short-link-redirector/ 302 (I use HTTP 302 redirects so that if third-party content moves over time I can at least update my redirects.) Create a project on Netlify and link it to the git repo (on GitHub or wherever else). It will automatically deploy your redirects to a subdomain on their domain which you can use to test (e.g., jakes-link.netlify.app). Pushes to the git repo will now be automatically deployed. In the "Domain management" section on the Netlify project, add your custom domain