setupRedirect(redirectId) {
        const {fromRegex, to, options: {permanent}} = this.redirects[redirectId];

        this.router.get(fromRegex, (req, res) => {
            const maxAge = permanent ? this.permanentMaxAge : 0;
            const toURL = parseURL(to);
            const toURLParams = parseQuerystring(toURL.query);
            const currentURL = parseURL(req.url);
            const currentURLParams = parseQuerystring(currentURL.query);
            const params = Object.assign({}, currentURLParams, toURLParams);
            const search = formatQuerystring(params);

            toURL.pathname = currentURL.pathname.replace(fromRegex, toURL.pathname);
            toURL.search = search !== '' ? `?${search}` : null;

            /**
             * Only if the url is internal should we prepend the Ghost subdirectory
             * @see https://github.com/TryGhost/Ghost/issues/10776
             */
            if (!toURL.hostname) {
                toURL.pathname = this.getSubdirectoryURL(toURL.pathname);
            }

            res.set({
                'Cache-Control': `public, max-age=${maxAge}`
            });

            res.redirect(permanent ? 301 : 302, formatURL(toURL));
        });
    }
@private
@param {string} redirectId
@returns {void}