I have an application running under Tomcat 6. In front of it I have an Apache server which is forwarding all requests. That is, the user "talks" to Apache and not to Tomcat. For some reason the Apache server receives a request to the URL:
http://www.example.com/myApp
then it has to be forwarded to http://www.example.com/$PREFIX/myApp
where $PREFIX
is a POST parameter. This $PREFIX
parameter is also available
as a COOKIE and as an extra header.
I couldn't find a way using mod_rewrite to read POST parameters/cookies/headers.
Is this possible at all? If not, should I use another Apache module/connector?
You can't use POST data for mod_rewrite. This is because the POST data isn't in the HEADER of the http request, it's in the BODY.
My suggestion would be that you perform an action on the posting page that adds the prefix to the URL, which would mean you don't even need to rewrite.