code: public String rewriteRefresh(String input, String requestUrl, String baseUrl, String visibleBaseUrl) {
          // Header has the following format
          // Refresh: 5; url=http://www.w3.org/pub/WWW/People.html
          int urlPosition = input.indexOf("url=");
          if (urlPosition >= 0) {
              String urlValue = input.substring(urlPosition + "url=".length());
              String targetUrlValue = rewriteUrl(urlValue, requestUrl, baseUrl, visibleBaseUrl, true);
              return input.substring(0, urlPosition) + "url=" + targetUrlValue;
          } else {
              return input;
          }
      }
docs: Rewrites a "Refresh" HTTP header or a &lt;meta http-equiv="refresh"... tag. The value should have the following
  format:
  
  Refresh: 5; url=http://www.example.com
  
  @param input
  The refresh value to be rewritten.
  @param requestUrl
  The request URL.
  @param baseUrl
  The base URL selected for this request.
  @param visibleBaseUrl
  The base URL viewed by the browser.
  @return the rewritten refresh value