// (This is necessary to ensure our Session Cookie, which ends
// in a trailing slash, isn't lost by some browsers, e.g. IE)
String locationWithTrailingSlash = realRequest.getRequestURI() + "/";
// Reset any existing response headers -- instead we are going to redirect user to correct path
realResponse.reset();
// Redirect user to homepage with trailing slash
realResponse.sendRedirect(locationWithTrailingSlash);
}
// if force ssl is on and the user has authenticated and the request is not secure redirect to https