title: Setting Content-Type for static website hosted on AWS S3
body: <p>I'm hosting a static website on S3. To push my site to Amazon I use the s3cmd command line tool. All works fine except setting the Content-Type to <code>text/html;charset=utf-8</code>.</p>
  
  <p>I know I can set the charset in the meta tag in the HTML file, but I would like to avoid it.</p>
  
  <p>Here is the exact command I'm using:</p>
  
  <pre><code>s3cmd --add-header='Content-Encoding':'gzip'
      --add-header='Content-Type':'text/html;charset=utf-8'
      put index.html.gz s3://www.example.com/index.html
  </code></pre>
  
  <p>Here is the error I get:</p>
  
  <p>ERROR: S3 error: 403 (SignatureDoesNotMatch): The request signature we calculated does not match the signature you provided. Check your key and signing method.</p>
  
  <p>If I remove the <code>;charset=utf-8</code> part from the above command it works, but the Content-Type gets set to <code>text/html</code> not <code>text/html;charset=utf-8</code>.</p>