tomcat-users mailing list archives

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

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

    RewriteRule !^/istore(.*) - [C]
    RewriteRule (.*) http://my.virtual.host/istore$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 -> http://my.virtual.host/istore/control/main
(3) reduce http://my.virtual.host/istore/control/main ->
/istore/control/main
(2) local pathresult: /istore/control/main
(2) prefixed with document_root to
f:/jboss-2.4.4_tomcat-4.0.2b/jboss/deploy/istore.war/istore/control/main
(1) go-ahead with
f:/jboss-2.4.4_tomcat-4.0.2b/jboss/deploy/istore.war/istore/control/main
[OK]

I tried the [P] flag to proxy it:

    RewriteRule !^/istore(.*) - [C]
    RewriteRule (.*) http://my.virtual.host/istore$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.

thanks
János

--
Jarecsni, János
MORGAN HILL CONSULTING, Internet Applications Unit
mailto:Jarecsni.Janos@morganhillconsulting.hu
http://morganhillconsulting.hu/ :: Phone+Fax: + 36 1 484 0392


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message