int pathLength = path.length();
if (pathLength != 0 && (path.charAt(0) == '/')
&& !servletPath.endsWith("rwt-resources")
- && !path.equals("/")) {
+ && path.lastIndexOf('/')!=0) {
String newLocation = request.getServletPath() + "#" + path;
response.setHeader("Location", newLocation);
response.setStatus(HttpServletResponse.SC_FOUND);