I’m getting 404 errors on a specific path pattern say xyz/index.html, how to return custom HTML content instead of a 404 Not Found error?
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
You can achieve this using CLoudfront Edge Functions:
us-east-1
region (irrespective of your local region).Trusted Relationships
to allow access for cloudfront.Capabilities
Go to your
Cloudfront Distribiution
you want to create a custom error page.Error Responses
There’s a blog post on how to do it step by step here.
Full documentation on generating custom error responses for Cloudfront is here.