You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Philip Hunt (Straker Software)" <ph...@shadocms.com> on 2010/04/26 13:56:36 UTC

JkMount and Apache Rewrite

Hi,

I have the following config, to pass requests through Apache to Tomcat using
AJP:

RewriteEngine on
RewriteRule ^/abc - [L,PT]
RewriteRule (.*) /abc$1 [L,PT]

JkMount /abc/* node1

This works, to the point that requests to http://sitename/ are rewritten to
http://sitename/abc ... and the JkMount directive finds a match, and passes
the request off to a worker.

However, I need JkMount to preserve the rewritten URI and it doesn't appear
to be doing that.

A request to http://sitename/ gets rewritten to http://sitename/abc ... but,
goes to the worker as http://sitename/

Does anyone know how I can preserve the rewritten URI when passing to the
worker?


Thanks,
Phil

-- 
Philip Hunt
System Administrator
Straker Software
phone: +64 28 899 4802
email: philip.hunt@strakersoftware.com
web: http://www.shadocms.com

Re: JkMount and Apache Rewrite

Posted by Rainer Jung <ra...@kippdata.de>.
On 26.04.2010 13:56, Philip Hunt (Straker Software) wrote:
> Hi,
>
> I have the following config, to pass requests through Apache to Tomcat using
> AJP:
>
> RewriteEngine on
> RewriteRule ^/abc - [L,PT]
> RewriteRule (.*) /abc$1 [L,PT]
>
> JkMount /abc/* node1
>
> This works, to the point that requests to http://sitename/ are rewritten to
> http://sitename/abc ... and the JkMount directive finds a match, and passes
> the request off to a worker.
>
> However, I need JkMount to preserve the rewritten URI and it doesn't appear
> to be doing that.
>
> A request to http://sitename/ gets rewritten to http://sitename/abc ... but,
> goes to the worker as http://sitename/
>
> Does anyone know how I can preserve the rewritten URI when passing to the
> worker?

Look at the "Forwarding" section in:

http://tomcat.apache.org/connectors-doc/reference/apache.html

and also at

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

It could be you copied an outdated default configuration setting an 
exotic JkOption. With modern releases (actual: 1.2.30) you should no 
longer need a Forward-JkOption.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org