2 min read

Redirects with netlify

I recently saw this tweet from Danielle Navarro about purchasing a domain to serve redirects to important links.

What a great idea! I’m pretty sure I will never memorize https://orcid.org/0000-0002-4648-654X, so it would be nice to have something easier to share. But, I don’t want to purchase a separate domain. 💸😭

Fear not, Rob J Hyndman notes that netlify has an easy way to setup redirects from your domain!

Let’s see if I can get this to work! According to the netlify documentation, there are two ways to do redirects. One is fairly simple, but less powerful. I like simple, so I’ll go with that.

Here are the steps:

  1. Create the following file: static/_redirects
  2. Fill it with urls like so:

    # Redirect from yourdomain.com*, to url
    /orcid        https://orcid.org/0000-0002-4648-654X
    /researchgate https://www.researchgate.net/profile/Eric_Bryant
    /twitter      https://twitter.com/EricBryantPhD
    /github       https://github.com/EricBryantPhD

Now, I can share my ORCID profile with ericbryantphd.com/orcid. 🥳

Of course, the downside of this is that it isn’t really clear that these links will redirect, which is not very transparent (i.e. kinda rude actually) as noted by Danielle:

For this use case though, I think it is fairly clear that e.g. ericbryantphd.com/orcid will take you to a page having something to do with ORCID, and e.g. ericbryantphd.com/github will take you to a page having something to do with GitHub, so I’m sticking to it!