I don't understand why this redirect rule is not working

Can someone help me understand why this redirect rule is not working?

I expect ALL traffic to subdomain.mydomain.com to get redirected to google EXCEPT the /api traffic. So everything EXCEPT /api should redirect to google. but it seems to be doing the opposite. lol…
to be clear, i want only api traffic to go through to my origin. everything else redirected.