I been trying to find a way to make it so when a user tries to "hotlink" or view content outside of viewing it directly through a page on my site which references S3 content that they will be served a generic image in the root of my bucket instead of the below XML browser output
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>6C57766666DF18C</RequestId>
<HostId>
bkreFGYkuilWBwa2xs3S35+CqofLB4ay1gD4UAEtmGJEaqE9tHvUZrsJO7i2JRw
</HostId>
</Error>
Any help or points in the right direction greatly appreciated
I already have a policy that restricts the content to only showing within my domain, just need the show a custom image part
Additionally the following information is good to know.
Create your bucket, inside of that bucket upload 2 files index.html and error.html, then set these both to public.
In your settings for this bucket go to Static Web Hosting and in for Index Document enter index.html and for Error Document enter error.html, now you can try to access wrong documents and get the error.html file.
Put your custome image in the document explained here
Make sure you read Error Documents and Browser Behavior at the bottom of the page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With