code: public URI rewriteURI(Request request) throws URISyntaxException {
          String path = request.path();
          if (!path.startsWith(prefix)) {
              return null;
          }
  
          StringBuilder uri = new StringBuilder(redirectTo);
          if (redirectTo.endsWith("/")) {
              uri.setLength(uri.length() - 1);
          }
          String rest = path.substring(prefix.length());
          if (!rest.startsWith("/") && !rest.isEmpty()) {
              uri.append("/");
          }
          uri.append(rest);
  
          // Do we have a query String
          int index = request.uri().indexOf("?");
          String query = null;
          if (index != -1) {
              // Remove the ?
              query = request.uri().substring(index + 1);
          }
  
          if (!Strings.isNullOrEmpty(query)) {
              uri.append("?").append(query);
          }
  
          return URI.create(uri.toString()).normalize();
      }
docs: Computes the URI where the request need to be transferred.
  
  @param request the request
  @return the URI
  @throws java.net.URISyntaxException if the URI cannot be computed