0

How can I costomize error page of my S3 bucket when the user tries something that does not exist.

I can not use "Static website hosting", because static virtual host only deals with public objects, I'll mess with private objects, generating url presign,

Url presign does not work with endpoint "Static website hosting"

I'm using PHP.

Any ideas? thank you very much

aynber
  • 22,380
  • 8
  • 50
  • 63

1 Answers1

1

The only native way to combine S3 private content and custom error pages is to use CloudFront in front of your bucket and create CloudFront custom error pages and use CloudFront signed URLs with an Origin Access Identity.

If you are adventurous and creative, it's also possible to use HAProxy in front of a bucket, with a Lua script on the proxy to hijack and modify the error responses inside the proxy, described here.

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427