title: How should I treat error.html on Amazon S3?
body: <p>I have a static website at Amazon AWS Cloud S3 bucket. The website is served using CloudFront.</p>
  
  <p>In <strong>Static website hosting</strong> settings under the bucket properties I have specified page <code>error.html</code> as <strong>Error document</strong> for the website. Now whenever someone goes to a page that doesn't exist, my custom error document - error.html content is served together with 404 header. That is good.</p>
  
  <p>The problem is when someone navigates directly to the <a href="https://www.example.com/error.html" rel="nofollow noreferrer">https://www.example.com/error.html</a> the error.html is served with HTTP status code: 200. This means this <strong>page can be crawled by search engine bots and indexed</strong>.</p>
  
  <p>What should I do about this page?</p>
  
  <p>Should I only add <strong>noindex</strong> into error.html <code>&lt;head&gt;</code>:</p>
  
  <pre><code>&lt;meta name="robots" content="noindex"&gt;
  </code></pre>
  
  <p>OR somehow <strong>change the header response</strong> in S3/CloudFront settings? How?</p>