Obviously, there are a lot of mod rewrite discussions and answers all across the web. However, I am having a hard time grasping them. So I thought I would ask here.
From my production server:
ServerName XXX.com
DocumentRoot /home/www/XXX.com/www
# Local Tomcat server
ProxyPass http://localhost:8080/api/
ProxyPassReverse http://localhost:8080/api/
RewriteEngine On
# If an existing asset or directory or API is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d [OR]
RewriteCond %{REQUEST_URI} /api
RewriteRule ^ - [L]
# If the requested resource doesn't exist (and is not API), use index.html
RewriteRule ^ /index.html
ErrorLog logs/XXX.com-error.log
CustomLog logs/XXX.com-access.log common
Please note, that "!" before "/api" in the accepted answer is incorrect.