Redirect custom urls in Netlify

Netlify is a very common and easy to use platform to host static sites.

Sometimes you need to add a redirect, from an old URL to a new URL in netlify (such as if you (rename a blog post url, as I had to do with 11ty)

This is easy to set up in Netlify.

Add a new file called _redirects in your root directory (where package.json etc is if using a JS based SSG).

And use this format:

/post/old-url/ /post/new-url/
/post/old-url2/ /post/new-url2/

Comments Redirect custom urls in Netlify