title: CNAME to s3 bucket amazon
body: <p>I would like to use a subdomain instead of the direct url to my s3 bucket at amazon.com. So instead of downloading images via an url like <code>http://bucket-images.s3-eu-west-1.amazonaws.com/path/to/image.png</code>I would like to use <code>http://assets.domain.com/path/to/image.png</code>. I tried setting a CNAME like this:</p>
  
  <pre><code>CNAME   assets   domain.com    bucket-images.s3-eu-west-1.amazonaws.com
  </code></pre>
  
  <p>But after setting this CNAME I receive such error from amazon, when I visit the domain:</p>
  
  <pre><code>&lt;Error&gt;
      &lt;Code&gt;NoSuchBucket&lt;/Code&gt;
      &lt;Message&gt;The specified bucket does not exist&lt;/Message&gt;
      &lt;BucketName&gt;assets.domain.com&lt;/BucketName&gt;
      &lt;RequestId&gt;45646DFSDFSFASDF&lt;/RequestId&gt;
      &lt;HostId&gt;
          dfasdcvcvd546456454ds5fasdf4ad5f64asdfasdfccdfgvggtg
      &lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>Over here they're telling to change the bucketname: <a href="https://forums.aws.amazon.com/message.jspa?messageID=237562" rel="noreferrer">https://forums.aws.amazon.com/message.jspa?messageID=237562</a>
  But that doesn't make sense. I worked on a project earlier, who used a bucketname totally different from the subdomain. So there has to be a way... Anyone who can help me out?</p>