Try another redirect rule if one leads to 404

Hi!
I’m using the _redirects file on my freshly migrated blog https://www.ilcucchiaiononesiste.it. I was using WordPress.

My file contains these rules:
/:year/:month/:day/:slug /:year/:month/:slug
/:year/:month/:day/:slug /archive/:year/:month/:slug

I want that if the first rule leads to a 404 the second rule kicks in.
Translated: I moved some posts to an “archive” subfolder and I want that if a post is not reachable it has to be reached in the archive.

Is that possibile in any way?

Thanks in advance!

No, it’s not possible. You need to use Edge Functions to achieve this.

1 Like

Thanks, I’m readind the docs about edge functions :wink: