Subject: RewriteRule / mod_jk / sessionid problem
Posted By: egod123 Post Date: 6/7/2006 3:13:49 PM
I have a rule that states
www.mydomain.com/any-text
gets rewritten to
www.mydomain.com/myapp/welcome.do?parameter=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
www.mydomain.com/myapp/welcome.do?parameter=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
www.mydomain.com/myapp/welcome.do?parameter=any-text
* I find www.mydomain.com/myapp/welcome.do?parameter=any-text with a
sessionid!

I'd like to avoid using javascript redirect or similar

Thanks in advance!
Reply By: silknando Reply Date: 12/13/2006 11:42:43 AM
Hi...

I think i am having the same problem or similar...

Do you know any solution or something new?

Thanks,
Fernando

Go to topic 23762

Return to index page 95
Return to index page 94
Return to index page 93
Return to index page 92
Return to index page 91
Return to index page 90
Return to index page 89
Return to index page 88
Return to index page 87
Return to index page 86