How do I redirect in a class sub-classing the EventSubscriber class?
To catch a 404 exception you need to subscribe to a KernelEvents::EXCEPTION event. As there is already a base class for html exceptions you don't need to code this yourself. You can simply put the code in an on404() method of a class that extends HttpExceptionSubscriberBase:


  Utility base class for exception subscribers.
  
  A subscriber may extend this class and implement getHandledFormats()
  to indicate which request formats it will respond to. Then implement
  an on*() method for any error code (HTTP response code) that should be
  handled. For example, to handle 404 Not Found messages add a method:
  
  public function on404(GetResponseForExceptionEvent $event) {}
  
  That method should then call $event->setResponse() to set the response
  object for the exception. Alternatively, it may opt not to do so and
  then other listeners will have the opportunity to handle the
  exception.