question

Matt-6115 avatar image
0 Votes"
Matt-6115 asked Matt-6115 commented

Apex Domain Angular Azure Static Web App - 404 on Refresh or Direct Link Navigation

I have an Angular web application hosted with Azure Static Web App. I have registered the app with a custom domain using the apex domain(s) (www.<myapp>.com and <myapp>.com). I have added a staticwebapp.config.json to properly route refreshes or direct link navigation through the Angular application's routing. The staticwebapp.config.json contains the following content:
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/assets/images/.{png,jpg,gif}", "/css/"]
}
}

This configuration does not appear to be working. Navigating directly to valid application links loads the Azure 404 page instead of falling back to the app's routing. I am wondering if I am missing a piece of configuration for the apex domain to properly reroute to the client application.

The same configuration works fine in a separate Azure Static Web App deployment set up as the "staging" environment. It is using the same custom domain, but is using a different, non-apex subdomain (staging.<myapp>.com).

azure-webapps-custom-domainsazure-static-web-apps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We have reached out to this customer offline. If the community has any suggestions, please share them here.

0 Votes 0 ·

0 Answers