title: Use custom error page for Tomcat's 404 Page when using mod_jk and Apache httpd
body: <p>We have setup like this:</p>
  
  <pre><code>httpd &lt;-&gt; mod_jk (Tomcat)
  </code></pre>
  
  <p>httpd is configured to forward all request to URL /app* to mod_jk. 
  httpd is configured with custom error pages for HTTP errors 404, 500 etc.</p>
  
  <p>If user enters URL,  <code>http://hostname/non-existing-page</code> - then httpd's custom 404 error page is displayed.</p>
  
  <p>If user enters URL, <code>http://hostname/app-blabblah</code> - then, Tomcat's 404 error page is displayed.  The application hosted at /app can deal with 404 errors if it is something like /app/non-existentpage.  But context /app-blablah does not resolve to any war file on Tomcat, and hence results in Tomcat's 404 error page.</p>
  
  <p>We are using stripped down version of Tomcat, its webapps folder has only <code>app.war</code>.</p>
  
  <p>I have been asked to not display Tomcat 404 error page as it reveals the fact that app is hosted on Tomcat and also displays Tomcat's version.</p>
  
  <p>If anyone can tell me how to:</p>
  
  <ol>
  <li>Add custom 404 error page for Tomcat when it has to deal with URLs that represents non-existing context. </li>
  <li>Or configure httpd such that if it sees that Tomcat is returning 404 error, it renders its own custom 404 error page.</li>
  </ol>
  
  <p><s> PS: I am not at liberty to point only /app/* to mod_jk, as we sometimes deploy other wars that start with app for debugging purposes - for e.g. app-debug.war. </s>  </p>
  
  <p><strong>Update: I am changing mod_jk workers.properties to forward only /app/* to Tomcat.</strong></p>