public function redirectMyContentTypeNode(GetResponseEvent $event) {
    $request = $event->getRequest();
    $language = $this->languageManager->getCurrentLanguage()->getId();

    if ($request->attributes->get('_route') !== 'entity.node.canonical') {
      return;
    }

    if ($request->attributes->get('node')->getType() !== 'challenge') {
      return;
    }

    // $redirect_url = Url::fromUri('entity:node/123');.
    $node = $request->attributes->get('node');
    if ($language == 'fr') {
      $redirect_url = '/fr/defis/' . $node->getTranslation('fr')->get('field_friendly_url')->getValue()[0]['value'];
    }
    else {
      $redirect_url = '/en/challenges/' . $node->get('field_friendly_url')->getValue()[0]['value'];
    }

    $response = new RedirectResponse($redirect_url, 301);
    $event->setResponse($response);
  }