Redirect from route when the controller has been changed
With the help from @4k4 I found a solution.

I created an event subscriber that extends the HttpExceptionSubscriberBase class. There I created the redirect like this:

public function on404(GetResponseForExceptionEvent $event) {
  $response = new TrustedRedirectResponse('https://google.com', 307);
  $event-&gt;setResponse($response);
}