- Newest
- Most votes
- Most comments
Hello.
I tried doing this in the error page section however its just giving the same error (which is actually a 200 but Access Denied). I tried to follow this - https://aws.amazon.com/blogs/aws/custom-error-pages-and-responses-for-amazon-cloudfront/ but still get that same error.
I'm not sure what kind of error is occurring based on this explanation alone, but could you please share the specific error message?
In rare cases, the object path of the redirect destination is incorrect and cannot be displayed.
I think it is possible that some cache is left behind and the operation seems strange.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages-expiration.html
Just to be sure, try clearing the CloudFront cache.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
- Private Bucket Access: Use an OAI to ensure CloudFront can access the S3 bucket.
- CloudFront Setup: Correctly configure the origin and behaviors to point to your S3 bucket.
- Custom Error Handling: Set up custom error responses to serve the 404.html page for any 404 errors encountered.
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 6 months ago

Thanks for the replies. I am currently on my iPad / Chrome so the response is a bit different, but when I got goto a new URL thatI know doesn’t exist such as example.com/badpage123.html I get the following;
AccessDeniedAccess DeniedE74NCHWK40BH0MPH984aITelIKEaDKHERKJnvpG1n3spskd1fQtmj1xBVB392D23BXMCKYdM1Q1JIoC4jshbCpQ77SY=
I have a clean HTML file called 404.html and I just want all 404’s to go there, however I think the above is not sending a 404 but rather a 200 and just an access denied.
I did create the error page setup in the distro - so in the error page section added an error page, type 404, goto 404.html with a 200 code.