Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 10
    YES I had to add 403 as well Commented Jul 22, 2020 at 0:30
  • 2
    Wouldn't this have the undesirable behaviour of routing legitimate 404s to index.html, including for images etc.? Sometimes you do want to have a real 404. Commented Aug 20, 2020 at 1:56
  • 1
    That's the idea behind "your application will manage the routing". Each request goes through your index.html (single page application) and your application's router returns the relevant response. This means you keep the routing logic in the app itself, while avoiding the maintenance of another routing logic in CloudFront. This is just a nice trick which makes the developer's life easier - routing as a one stop shop, no need to know anything about AWS Commented Aug 20, 2020 at 7:29
  • 1
    Well, except that your application in this case is client-side, not server-side. As such, as 'application' you cannot signal any longer that a resource has not been found. I think that you should make a distinction between routes and files that will be handled by the application and routes that will be handled by S3 or cloudfront. Commented Aug 20, 2020 at 10:25
  • Yes It works for me as well Commented Oct 18, 2021 at 9:50