How can I redirect node page for a content type to custom URL? I need to redirect all the pages for a content type to a custom URL in Drupal 8.

I used to do this in Drupal 7 by implementing hook_init() with the function drupal_goto() or by using the Rules module. Unfortunately both hook_init() and drupal_goto() are removed in Drupal 8, and the Rules module is not stable yet, and I can't figure out how to do it in Drupal 8.

How can I achieve what I am trying to do?
Here is how I managed to solve this issue, based on the example in drupal.org/node/2013014:

I registered Event Subscriber in my_redirect_module.services.yml file:

   services:
     my_redirect_module_event_subscriber:
     class: Drupal\hbmsu_redirect\EventSubscriber\MyRedirectModuleSubscriber
     tags:
       - {name: event_subscriber}


and then in the file my_redirect_module/src/EventSubscriber/MyRedirectModuleSubscriber.php

I added this code:

  namespace Drupal\my_redirect_module\EventSubscriber;

  use Symfony\Component\HttpFoundation\RedirectResponse;
  use Symfony\Component\HttpKernel\KernelEvents;
  use Symfony\Component\HttpKernel\Event\GetResponseEvent;
  use Symfony\Component\EventDispatcher\EventSubscriberInterface;

  class MyRedirectModuleSubscriber implements EventSubscriberInterface {

      public function checkForRedirection(GetResponseEvent $event) {

          $baseUrl = $event-&gt;getRequest()-&gt;getBaseUrl();
          $attr = $event-&gt;getRequest()-&gt;attributes;
          if(null !== $attr &amp;&amp;
             null !== $attr-&gt;get('node') &amp;&amp;
             $attr-&gt;get('node')-&gt;get('type')-&gt;getString() == 'my_content_type') {
              $event-&gt;setResponse(new RedirectResponse($baseUrl.'/some_internal_url_path'));
          }
      }

      /**
       * {@inheritdoc}
       */
      static function getSubscribedEvents() {
          $events[KernelEvents::REQUEST][] = array('checkForRedirection');
          return $events;
      }

  }


in checkForRedirection function, I'm checking if the page is for a node with the content type my_content_type, then redirect to the page mywebsite.com/some_internal_url_path