Skip to main content
ldstephens

The power of _redirects

Hey friends, when I migrated ldstephens from WordPress to Eleventy, I had a three goals:

With Netlify redirects, I made all of this happen.

Redirecting Old URLs to New URLs

/2016/*/:slug/ /blog/:slug/ 301!
/2017/*/:slug/ /blog/:slug/ 301!
/2018/*/:slug/ /blog/:slug/ 301!
/2019/*/:slug/ /blog/:slug/ 301!
/2020/*/:slug/ /blog/:slug/ 301!
/2021/*/:slug/ /blog/:slug/ 301!
/2022/*/:slug/ /blog/:slug/ 301!
/2023/*/:slug/ /blog/:slug/ 301!
/2024/*/:slug/ /blog/:slug/ 301!

This does three things:

Redirecting the Old RSS Feed

/feed      https://ldstephens.net/feed/feed.xml    301
/feed.xml  https://ldstephens.net/feed/feed.xml    301

Now, anyone subscribed to the old feed gets the new one automatically.

Keeping ldstephens.me RSS Subscribers Connected

On ldstephens.me, I updated the _redirects file:

/feed      https://ldstephens.net/feed  200!
/feed.xml  https://ldstephens.net/feed.xml  200!

Instead of redirecting, this proxies requests to the new feed. The 200! ensures the feed loads from ldstephens.net instead of bouncing users around. The catch, both sites need to be on Netlify for this to work.

I'm new to this kind of thing, so being able to set up redirects felt like fucking magic. You just can't do this if your site is locked into a hosted platform. This is why owning your blog matters.