<p>you can catch an error like 404 and redirect it to 200 and your index.html with custom error pages in cloudfront like shown here <a href="https://www.youtube.com/watch?v=gBkysF8_-Es" rel="nofollow noreferrer">https://www.youtube.com/watch?v=gBkysF8_-Es</a></p>

CC BY-SA 4.0
2021-08-13T14:26:56.743Z
2021-08-13T14:26:56.743Z
danny kaplunski
<p>we have a single page app in ReactJS that is being served by CloudFront but the response status continues to be 404 for any nested pages (i.e pages other than the home page).</p>
<p>How can this be resolved? Attached snapshot</p>
<p><a href="https://i.sstatic.net/RoCr5.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RoCr5.jpg" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-07-14T06:14:12.007Z
Seems like an issue with Credentials. Did you double check them?
Sandun
<amazon-web-services><amazon-s3><amazon-cloudfront>
404 status code in response from Cloudfront for a single page react application
systemdebt
# 404 status code in response from Cloudfront for a single page react application

(Asked by: username_0 on 2021-07-12)

we have a single page app in ReactJS that is being served by CloudFront but the response status continues to be 404 for any nested pages (i.e pages other than the home page).

How can this be resolved? Attached snapshot

[![enter image description here](https://i.sstatic.net/RoCr5.jpg)](https://i.sstatic.net/RoCr5.jpg)

**Tags:** amazon-web-services, amazon-s3, amazon-cloudfront

> **Comments:**
> **username_1**: Seems like an issue with Credentials. Did you double check them?  

---

## 1 answers

### Answer by username_2 on 2021-08-13. Score: 1 | Accepted answer

you can catch an error like 404 and redirect it to 200 and your index.html with custom error pages in cloudfront like shown here <https://www.youtube.com/watch?v=gBkysF8_-Es>


---

