Tell taxonomy links to use route in custom module
In my case, I'm also using a RouteSubscriber to change the default controller responsible for handling taxonomy term entities. I also wanted to use a custom template only for a specific taxonomy (called my_taxonomy in the example below).
Here is the code for the RouteSubscriber:
&lt;?php

namespace Drupal\my_module\Routing;

use Drupal\Core\Routing\RoutingEvents;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

class RouteSubscriber extends RouteSubscriberBase {

    /**
     * {@inheritdoc}
     */
    protected function alterRoutes(RouteCollection $collection) {
        if ($route = $collection-&gt;get('entity.taxonomy_term.canonical')) {
            $route-&gt;setDefaults([
                '_controller' =&gt; '\Drupal\my_module\Controller\DefaultController::listAll',
            ]);
        }
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() {
        $events[RoutingEvents::ALTER] = ['onAlterRoutes', -200];
        return $events;
    }

}

And here is the code for the controller. Note that a custom render array can be returned only for terms of the specific taxonomy my_taxonomy. All other terms fall back to the default controller used by the views module in the original route:
&lt;?php

namespace Drupal\my_module\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\taxonomy\Entity\Term;
use Drupal\views\Routing\ViewPageController;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends ControllerBase {

    public function listAll(Request $request) {
        $render = [];

        $tid = \Drupal::routeMatch()-&gt;getRawParameter('taxonomy_term');
        $term = Term::load($tid);
        $bundle = $term-&gt;bundle();
        if ($bundle == 'my_taxonomy') {
            // render array for your custom template
        } else {
            // falls back to the default ViewPageController to handle all other taxonomies
            $viewPageController = new ViewPageController();
            $render = $viewPageController-&gt;handle('taxonomy_term', 'page_1', \Drupal::routeMatch());
        }

        // Return render array
        return $render;
    }

}