We have a react app hosted in Azure Blog Storage as a static web app. Our issue is once the site is deployed, the initial homepage loads with a 200 status code but if i navigate using react routing to any other route and then refresh the page, the page content loads correctly but the server shows a 404 response code for that route.
What I've tried to do to fix the issue:
The index document name
and Error document path
have index.html as the value & i added the staticwebapp.config.json to the react app public directory (also tried to just add it to the root app directory but it didn't show up in the built artifacts unless i put it in the /public folder) with the following configuration:
{
"navigationFallback": {
"rewrite": "index.html",
"exclude": ["/static/media/.{png,jpg,gif,svg,gz,js,css}", "/static/css/"]
},
"mimeTypes": {
".json": "text/json"
},
"routes": []
}
I haven't added any rewrite rules to the rules engine since I was hoping this could be solved without it. Looking for any help on the subject matter.
Thanks in advance!
Jeff