How can I configure Oracle ORDS (standalone server) to work with a React application that uses client side routing.
Client side routing needs to ensure that ORDS serves the React app's entry point (index.html
) for all routes managed by the client side router. This is essential because router handles routing on the client side, while ORDS, being a backend service, could otherwise interfere with routes it doesn’t recognise.
In OHS this was done by using the Apache RewriteEngine but how can this be done in ORDS?
<Location /my_app>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
RewriteRule ^ index.html [L]
</Location>