Google has cached some old URLs to pages that no longer exist on a site. I'd like to redirect any 404 pages to the home page.
I have a jetty installation with a ROOT.war file installed in jetty/webapps. The ROOT.war file contains a WEB-INF/web.xml file that has the following in it:
<error-page>
<error-code>404</error-code>
<location>/</location>
</error-page>
However, this is only redirecting top level files, nothing in subdirectories. So the following URL get redirected to the home page:
http://mysite.com/pageDoesntExist.html
But this one doesn't and just gives a 404 error:
http://mysite.com/directoryDoesntExist/pageDoesntExist.html
Is there a way to configure all 404's to go to the home page? Can I do this in the jetty/contexts directory somehow?