I have got the tomcat 8 rewrite to work but seems to missing something in rewrite.config that is causing the last condition to not execute. For benefit of others, i have the
I seem to have got it fixed. There are couple of things i found and sharing it for others. The below thing worked finally for me. Below are the contents in rewrite.config. It should be placed in webapps//WEB-INF/ directory.
RewriteCond %{REQUEST_URI} .*\.(css|js|html|png|jpg|jpeg|gif|txt|ttf|json|woff|ico)$ [OR]
RewriteCond %{REQUEST_URI} ^(/api/).*$ [OR]
RewriteRule ^(.*)$ - [L]
RewriteRule ^(.*)$ /index.html
There are a couple of things that were needed. The way i ensure my app is the default app is by adding below snippet in HOST configuration in server.xml. Please note that if you are using this approach to make your app the default app the valve adding should be done in the Context block in server.xml and it works and putting the same in your application/META-INF/context.xml does not seem to do the trick. It surely loads the configuration but rewrite does not happen. The PreResources thing kept in the application/META-INF/context.xml seems to work fine.
server.xml snippet
....
HTH, Thanks