I have a rule that states
www.mydomain.com/any-text
gets rewritten to
http://www.mydomain.com/myapp/welcom...meter=any-text
RewriteRule ^/([A-Za-z0-9-]+)?$ /myapp/welcome.do?parameter=$1 [R]
The new URL contains "/myapp/", so is passed to the apache-tomcat due to the
following instruction:
<Location "/myapp/*">
JkMount myapp
Allow from all
</Location>
(I'm using jakarta struts framework for the myapp application)
My problem is that the sessionid assigned to the user doesn't appear in the
apache log until the customer clicks beyond
http://www.mydomain.com/myapp/welcom...meter=any-text. Hitting the first URL
in the app sets the sessionid in a cookie on the users machine, subsequent
requests are logged with the sessionid in the apache log. I really need the
sessionid to be logged during the initial rewrite.
Is there an easy way to use a RewriteRule and mod_jk to resolve this?
I was thinking of something along the lines of:
* The rewrite rule can 'pass through' to a JkMount instruction.
* The 'any-text' parameter is passed to a servlet.
* The servlet sets the sessionid (cookie)
* The servlet forwards to
http://www.mydomain.com/myapp/welcom...meter=any-text
* I find
http://www.mydomain.com/myapp/welcom...meter=any-text with a
sessionid!
I'd like to avoid using javascript redirect or similar
Thanks in advance!