Options -MultiViews
RewriteEngine On
RewriteBase /

# Handle React client-side routing — page refresh works correctly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

# Proxy /api calls to Spring Boot backend running on port 8080
RewriteCond %{REQUEST_URI} ^/api/
RewriteRule ^api/(.*)$ http://localhost:8080/api/$1 [P,L]
