Redirect with entry id

Given the existing article path:

articles/{id}/{slug}

How could I resolve/redirect to the same article after the slug is updated? For example

Desired behavior:

If I visit: articles/123456/a-cool-entry Then, it's redirected to the updated URL: articles/123456/a-cool-entry-updated

So basically, the article identifier should be the {id} and then fetch that entry to redirect to the correct path.

I'd like to make this if the url isn't found, as a fallback in case it was updated for some reason (for example a tutorial to Airlock that now should refer to Sanctum instead).

In common Laravel I'd search for the {id} to then construct the correct url to redirect, but I don't know how to handle this using Statamic

Thanks in advance :)

>>>>>>> Unanswered <<<<<<<
1 Reply
2 Followers