public void handle(
final HttpRequest request,
final HttpResponse response,
final HttpContext context) throws HttpException, IOException {
HttpInetConnection conn = (HttpInetConnection) context.getAttribute(
ExecutionContext.HTTP_CONNECTION);
ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
String uri = request.getRequestLine().getUri();
if (uri.equals("/oldlocation/")) {
String redirectUrl = this.schemeName + "://localhost:" + conn.getLocalPort() + "/newlocation/";
response.setStatusLine(ver, this.statuscode);
response.addHeader(new BasicHeader("Location", redirectUrl));
response.addHeader(new BasicHeader("Connection", "close"));
} else if (uri.equals("/newlocation/")) {
response.setStatusLine(ver, HttpStatus.SC_OK);