How is it possible to redirect requests Tomcat 5.5 receives with certain URL match to another Tomcat instance on another host, like I could do on an Apache host with rewrite rules?

Example: I'd like to redirect all requests on http://example.com:8080/xmpl to http://example.org:8080/xmpl (with full path and GET parameters), but leave http://example.com:8080/regular for Tomcat at example.com on port 8080. Here example.com and example.org are completely different hosts.


In the end, we used a placeholder webapp with URL Rewrite Filter, http://tuckey.org/urlrewrite/ and the filter configuration from Erik Isaksson. This spared us from rebooting the server, which was quite important for the specific case.


Place Apache in front of your Tomcat and use mod_jk to talk to your tomcat. You can then use all the power and features of Apache, as Tomcat really doesn't have any that you don't program yourself.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy