Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2021-08-13T14:26:56.743Z
Answers: 2021-08-13T14:26:56.743Z
Answers: danny kaplunski
Body: <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>
  
Comments: CC BY-SA 4.0
Comments: 2021-07-14T06:14:12.007Z
Comments: Seems like an issue with Credentials. Did you double check them?
Comments: Sandun
Tags: <amazon-web-services><amazon-s3><amazon-cloudfront>
Title: 404 status code in response from Cloudfront for a single page react application
UserDisplayName: systemdebt
ThreadText: # 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>
  
  
  ---
  
  