This is an extension of this question which I asked yesterday. While the answer to that question is correct, due to other circumstances that approach will be the last resort.

Therefore, I have tried a second approach which ought to work, but doesn't.

To recap, I am trying to make an application called newapplication available at the url http://server/oldapplication where the server is fronted by mod_jk in Apache. I want the new application to be available at the old application's URL. The answer to the previous question rightly asserted that the best option was to change the Tomcat configuration to change the name of the application context so that the application and request contexts matched.

Ideally we would like to do this purely on the Apache side. I have been informed that the following should work:

RewriteEngine on
RewriteRule ^/oldapplication.*$ /newapplication [PT]
<Location /newapplication>
  SetHandler jakarta-servlet
  SetEnv JK_WORKER_NAME loadbalancer
</Location>

But instead, when I request oldapplication I get a 302 to newapplication. I am trying to achieve this without a redirect.

We are running Apache/2.2.8.

link|improve this question

68% accept rate
Is the 302 to exactly /newapplication, or is it adding a trailing slash or anything else? And what's the rest of your config look like now? – Shane Madden Sep 6 '11 at 16:01
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.