I have deployed my Wicket app at /myapp in Tomcat, and I have put it behind Apache web server using
ProxyPass / http://localhost:8080/myapp/
ProxyPassReverse / http://localhost:8080/myapp/
Now Wicket incorrectly redirect users to /myapp/xxx instead of /xxx.
Is there any way to make Wicket(1.3.5) use / as my root path (instead of /myapp which is servlet deployment context path)?!
Edit: There is a solution described at following link but it doesn’t works for 1.3.5 version:
I found it: https://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html
Edit: The problem is that wicket uses relative path redirects with ServletResponse#sendRedirect and Tomcat convert them to absolutes redirects containing /myapp at beginning. I have tried mod_jk(AJP) but there was no difference!
There should be some way to tell proxy-pass or mod-jk to rewrite redirects before sending them to client!
You may find this Tomcat document helpful:
http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html
It addresses the above situation with RedirectMatch and mod_rewrite.