Home > Back-end >  Can an angular app on AWS S3 served via cloudfront resolve to another route apart from the index rou
Can an angular app on AWS S3 served via cloudfront resolve to another route apart from the index rou

Time:06-23

I have an angular app hosted on S3. When I try to directly go to a route like myapp.com/items I get a 403 forbidden error. But when I access the app from myapp.com everything is okay and from the app I can navigate to myapp.com/items. I don't understand why this is happening.

How can I make it so that routes like myapp.com/items can be accessed directly and not throw an error?

CodePudding user response:

On CloudFront distribution enter error pages tab

enter image description here

Then create a new error response to deal with any othe routes and redirect it to index.html file

enter image description here

  • Related