tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarecsni János <>
Subject Apache+Tomcat and the RewriteRule
Date Thu, 14 Feb 2002 17:15:17 GMT

how can I use Apache mod_rewrite to alias a dynamic resource (to be served
by tomcat thru ajp)???

    RewriteRule !^/istore(.*) - [C]
    RewriteRule (.*)$1 [L]

is not good since it handles the URL as a file after rule is matched (so it
prepends the document root, instead of passing the request to Tomcat [I have
the appropriate JkMounts]).

(2) init rewrite engine with requested uri /control/main
(3) applying pattern '^/istore(.*)' to uri '/control/main'
(3) applying pattern '(.*)' to uri '/control/main'
(2) rewrite /control/main ->
(3) reduce ->
(2) local pathresult: /istore/control/main
(2) prefixed with document_root to
(1) go-ahead with

I tried the [P] flag to proxy it:

    RewriteRule !^/istore(.*) - [C]
    RewriteRule (.*)$1 [P]

So we redirect the newly rewritten URL to ourselves back, for another round
of processing (which in deed will activate tomcat). The problem: cookies are
lost with this approach.

I tried a few other lists and archives but found absolutely nothing.


Jarecsni, János
MORGAN HILL CONSULTING, Internet Applications Unit :: Phone+Fax: + 36 1 484 0392

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message