Hi,
I came across the need to use mod_rewrite to rewrite some URLs I was sending
to Tomcat.
After playing with it a bit (I had it working a while ago) and finding that
Tomcat was not receiving the rewritten URLs no matter what I did, I took a
look at the source to native/apache1.3/mod_jk.c. Not being much of an
Apache hacker, the variables were descriptive enough to tell me to make this
change to the file:
--- mod_jk.c.orig Tue Aug 14 17:58:21 2001
+++ mod_jk.c Tue Aug 14 18:04:58 2001
@@ -358,7 +358,7 @@
s->method = (char *)r->method;
s->content_length = get_content_length(r);
s->query_string = r->args;
- s->req_uri = r->unparsed_uri;
+ s->req_uri = r->uri;
if (s->req_uri != NULL) {
char *query_str = strchr(s->req_uri, '?');
if (query_str != NULL) {
After this change my URLs were getting rewritten as expected again.
Can we apply this change to the tree if there's nothing wrong with it for
the next release? This problem has affected a large number of users, just
take a look at the tomcat-dev/user archives.
It seems that this change was made to satisfy the errata at
http://java.sun.com/products/servlet/errata_042700.html, but is it the
correct fix if we're intentionally munging the request?
Thanks,
Dave