Community
Participate
Working Groups
Build Identifier: jetty-7.1.6.v20100715 I confirmed that when seeing the headers from my server. This problem is critical as Google and some of the other search engines threat 302 differently from 301 and that will seriously affect a site ranking by splitting link value between the urls that you want to forward to one another. For example when redirecting non www version of the domain site to www. I looked at the source, but I am unable to fix that myself. It seems like response.setStatus(_permanent?HttpServletResponse.SC_MOVED_PERMANENTLY:HttpServletResponse.SC_FOUND); does not set status, probably because setStatus in org.eclipse.jetty.server.Response cannot set it properly after sendRedirect is passed. Maybe it has something to do with this line: if (!_connection.isIncluding()) -> set the status. This is all the help I can give. Please, fix this soon, many people have problems with it, without even knowing! Thanks! This is my context xml: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.server.handler.MovedContextHandler"> <Set name="contextPath">/</Set> <Set name="newContextURL">http://www.somedomain.com</Set> <Set name="permanent">true</Set> <Set name="discardPathInfo">false</Set> <Set name="discardQuery">false</Set> <Set name="virtualHosts"> <Array type="String"> <Item>somedomain.com</Item> <Item>111.111.111.111</Item> </Array> </Set> </Configure> Reproducible: Always Steps to Reproduce: 1. use MovedContextHandler in XML conf context (<Set name="permanent">true</Set>) 2. visit the source redirect url and get redirected 3. check the headers that server returned - they are 302, not 301
the sendRedirect line should have been deleted. fixed in r2222
Would that fix be in Jetty 7.2.2... ?? Or some CVN build?