1

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.

stivlo
  • 749
  • 3
  • 10
  • 24

1 Answers1

0

Which mod_jk's version are you running?

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

JkOptions     +ForwardURIProxy
quanta
  • 51,413
  • 19
  • 159
  • 217
  • mod-jk 1.2.28-2, I read from the [docs](http://tomcat.apache.org/connectors-doc/reference/apache.html) 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 03 '11 at 10:47