title: Apache Server RewriteRule to Tomcat WAR
body: <p>I'm trying to get Apache's RewriteEngine to rewrite some URL's to Tomcat Webapp Directories.
  It already works partially, but there is one thing that I cannot achieve.</p>
  
  <p>This is the scenario:</p>
  
  <p>I have apache and a tomcat running on a vps.
  On the tomcat I have a webapp called XYZ.
  On Apache, I use the jk_mod module with workers.properties to "connect" to the tomcat.
  In my httpd.conf I have a VitualHost set up as follows:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
     ServerName abc.domain.com
     RewriteEngine on
     RewriteRule ^/(.+)$ /XYZ/$1 [L,PT]
     JkMount /* XYZ
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>So far, so good. Without the RewriteRule I'd have to open the URL like this:</p>
  
  <pre><code>abc.domain.com/XYZ/home (where "home" is the jsp)
  abc.domain.com/XYZ/customers
  etc...
  </code></pre>
  
  <p>And the WITH the RewriteRule I'm down to this:</p>
  
  <pre><code>abc.domain.com/home
  abc.domain.com/customers
  etc...
  </code></pre>
  
  <p>Which is already pretty good for my goal, but there is just one more thing that needs to be done: I want to be able to open <code>abc.domain.com</code> and to be redirected to the last example above (home jsp).</p>
  
  <p>I've tried adding some other RewriteRules that would rewrite the root to <code>/XYZ/home</code> and also tried a <code>Redirect</code>, but none of those worked as I expected them to (nothing happened)...</p>
  
  <p>Can somebody please explain, how I can achieve this? </p>
  
  <p>Thank you very much in advance!</p>