My Spring application used to push server (shared tomcat 5.5) would react to all URL calls with 404 error (except /). After three days of effort, I discovered that:

However , within the production atmosphere tomcat has been fronted by an apache httpd which doesn't forward demands to tomcat for web addresses from the form /foobar (with no extension). Apache does not know how to approach individuals Web addresses and attempts to serve them as static files in the disk.

So, I have to configure apache to transmit all demands to tomcat. In my opinion, that will require changes to .htaccess files. I've .htaccess files within the below locations:

/public_html/.htaccess
/public_html/WEB-INF/.htaccess

Help me with .htaccess content to attain preferred objective.

You need to configure your [cde] directive for that Web addresses that represent your Tomcat application directly inside your <Location> configuration file -- or perhaps a corresponding file that's incorporated in a fashion that matches together with your distribution (or local atmosphere) configuration. (Search for the [cde] lines inside your primary Apache configuration file if you are unsure whether your distribution or local atmosphere is applying some mechanism to interrupt apart a configuration file.)

Should you put the httpd.conf directive for the Tomcat install within an include file, that file is going to be re-loaded and re-parsed on each and every request, which may have a performance impact. Should you put it within the primary configuration, it will be read and parsed once, at server startup (and every time you make use of the <Location> .htaccess choice to reload the configuration).