Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

Which mod_jk's version are you running?

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

JkOptions     +ForwardURIProxy
share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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