code: function createHandler(to, except, pathFunc, protocol) {
      return function(req, res, next) {
          var host = req.hostname || '';
          var url = req.url;
  
          if (host in except) {
              next();
          } else {
              var target = new URIjs(pathFunc(host, url))
                .host(to)
                .protocol(protocol || '')
                .href();
  
              res.redirect(301, target);
          }
      };
  }
docs: Creates the middleware to handle the redirect
  
  @param {String} to
  @param {Array} except
  @return {Function} middleware function(req, res, next)
  @api private