title: AWS S3 custom error document for access denied
body: <p>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</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Code&gt;AccessDenied&lt;/Code&gt;
  &lt;Message&gt;Access Denied&lt;/Message&gt;
  &lt;RequestId&gt;6C57766666DF18C&lt;/RequestId&gt;
  &lt;HostId&gt;
  bkreFGYkuilWBwa2xs3S35+CqofLB4ay1gD4UAEtmGJEaqE9tHvUZrsJO7i2JRw
  &lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>Any help or points in the right direction greatly appreciated</p>
  
  <p>I already have a policy that restricts the content to only showing within my domain, just need the show a custom image part</p>