Intelligent Routing if a service returns a 404

Hello guys,
I’d like to know if there’s a way to reroute traffic “intelligently” using istio.
I could get a 404 from one of my services and I’d like to re-send the same POST or GET message to another service which connects to a total different subset of DB and legacy services.

Do you think it’s something that can be done?

Cheers,
ALF