question

DanParker-0340 avatar image
0 Votes"
DanParker-0340 asked SumanthMarigowda-MSFT commented

Azure Static website react.js getting 404 in the browser but returning the correct content on a path

So like I normally setup static websites, with error page going back to index.html. The browser response shows a 404 though, on local it works ok and shows a 200. I'm not sure if this is an issue with the reactjs router or the azure static website configuration. Anyway to send this back as a 200
in my console shows

GET https://app.testsite.com/signup 404
Navigated to https://app.testsite.com/signup

and then works ok. Some browsers have issue with this as it shows red in the console

azure-blob-storageazure-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.

@DanParker-0340 Thanks for the update! Are still facing any issue, If so please let us know. If the issue is been fixed. Please do not forget to "Accept the answer” and “up-vote” your answer, this can be beneficial to other community members.

Looking forward for your reply!

Thanks,

0 Votes 0 ·

1 Answer

DanParker-0340 avatar image
1 Vote"
DanParker-0340 answered

Ah, I see this is solved by a CDN rewrite rule, having this over the azure storage 404 redirect, I found this here,

https://antbutcher.medium.com/hosting-a-react-js-app-on-azure-blob-storage-azure-cdn-for-ssl-and-routing-8fdf4a48feeb

at the SpaRewriteRules

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.