Hi all,
I have been searching for a while online but not sure if it’s I’m too new to the topic or there is actually not a lot of documentation on it out there. Whichever the case I’d appreciate your help or guidance…
What I’m trying to do is the classic redirect all requests to index.html with the exception of asset files. What we do in Apache with the following code in the .htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
I have something like this in my undertow-handlers.conf, which obviously does not work as expected but almost there:
regex['/[^\/]+\/.*'] -> rewrite['/index.html']
Was trying to find documentation on how to write a rewrite conditional for the asset files.
All I could find is this article:
https://gkedge.gitbooks.io/react-router-in-the-real/content/jboss_web_app.html
At the bottom there are 2 suggestions:
not file(%U) -> redirect('/index.html')
and
not equals[%R, '/'] and
not equals[%R, '/index.html'] and
regex['/.+'] -> rewrite['/km/index.html']
but none of them have worked for me…
Thanks again