How to route authorised requests through VPN only? Like if VPN is connected than our QA server reqests shall go through VPN and Production go normally

How to route authorised requests through VPN only? Like if VPN is connected than our QA server reqests shall go through VPN and Production go normally