Static Web App page reloads returning 404 and not following the navigationFallback policy
Laura Jiménez Valencia
0
Puntos de reputación
We have a SWA on Azure that returns a 404 Azure error page (on a page reload) instead of following the staticwebapp.config.json settings as described below:
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": [
"/data/*.json",
"/img/*",
"/fonts/*",
"*.{css,js,map,png,jpg,jpeg,gif,ico,svg,webp,ttf,woff,woff2,eot,json}"
]
},
"routes": [
{
"route": "/contacto",
"rewrite": "/index.html",
"statusCode": 301,
"allowedRoles": [
"anonymous"
]
}
]
}
The configuration file (staticwebapp.config.json) is in the root of the repository project.
The behavior:
- Load the SPA
- Navigate to some routes, notice no post back
- Do a full page reload, notice a post back
- See 404 azure page
Screenshot:
We have tried without adding the "routes" part in the file, and it does not work either.
Why is it not working?
Azure Static Web Apps
Azure Static Web Apps
Un servicio de Azure que proporciona el desarrollo optimizado de aplicaciones web de pila completa.
Inicie sesión para responder
