I want to redefine the base URL of a Tomcat webservice, mounted with JkMount. I tried the following:

JkMount /myapp/* ajp13_worker
RewriteRule ^/service/v1/(.*)$ /myapp/$1 [PT,QSA]

The original URLs work, for instance:

/myapp/
/myapp/brand
/myapp/classified?idBrand=0&priceMax=&page=1

The URL that I was trying to obtain were:

/service/v1/
/service/v1/brand
/service/v1/classified?idBrand=0&priceMax=&page=1

But they return 404 (from Apache, not from Tomcat). How to make it work?

UPDATE: I just forgot

RewriteEngine on

now it works.

link|improve this question

70% accept rate
feedback

1 Answer

Which mod_jk's version are you running?

Add the below line under the JkMount directive and try again:

JkOptions     +ForwardURIProxy
link|improve this answer
mod-jk 1.2.28-2, I read from the docs that should be the default value. The default value is "ForwardURIProxy" since version 1.2.24. Anyway as I wrote in the update adding "RewriteEngine on" works. – stivlo Oct 3 '11 at 10:47
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.