<p>This question is really more about S3 than about Craft. What you need for the assets is not the file path, but the url. And yes, S3 assets do have a url. <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">This page</a> describes the format for the host:</p>

<pre><code>&lt;bucket-name&gt;.s3-website-&lt;AWS-region&gt;.amazonaws.com
</code></pre>

<p>They give these examples:</p>

<blockquote>
  <p>This URL requests the photo.jpg object, which is stored at the root level in the bucket.</p>
</blockquote>

<pre><code>http://examplebucket.s3-website-us-east-1.amazonaws.com/photo.jpg
</code></pre>

<blockquote>
  <p>This URL requests the docs/doc1.html object in your bucket.</p>
</blockquote>

<pre><code>http://examplebucket.s3-website-us-east-1.amazonaws.com/docs/doc1.html
</code></pre>

CC BY-SA 3.0
2015-12-23T18:28:09.903Z
I feel silly having asked now. Thank you for clarifying that!
taylor
CC BY-SA 3.0
2015-12-28T18:52:36.340Z
I'd recommend setting setting up a CNAME in your DNS to point to S3 instead of grabbing it directly (basically mapping your bucket to something like ``cdn.whatever.com``). That gives you some flexibility if you ever need to cut AWS out of the picture or change datacenters within AWS.
RitterKnight
CC BY-SA 3.0
2015-12-23T10:16:12.970Z
2015-12-23T10:16:12.970Z
Marion Newlevant
<p>New to remote assets, and can't seem to find any information on accessing remote assets via filepath in areas twig can't be used, such as CSS. I'd like to be able to use those same assets in CSS files but can't seem to find them.</p>

<p>For example, if I named my remote Amazon S3 Asset Source handle to 'amazon', and it has sub folders <code>asset/images/template</code> for an example, would there be a way to reach the files in a file path such as <code>amazon/assets/images/template/filename.jpg</code> for use in CSS and whatnot?</p>

<p>Any information would be greatly appreciated. Thanks!</p>

<assets><css><s3>
Do Remote Assets (ie. S3) have file paths?
# Do Remote Assets (ie. S3) have file paths?

(Asked by: username_0 on 2015-12-23)

New to remote assets, and can't seem to find any information on accessing remote assets via filepath in areas twig can't be used, such as CSS. I'd like to be able to use those same assets in CSS files but can't seem to find them.

For example, if I named my remote Amazon S3 Asset Source handle to 'amazon', and it has sub folders `asset/images/template` for an example, would there be a way to reach the files in a file path such as `amazon/assets/images/template/filename.jpg` for use in CSS and whatnot?

Any information would be greatly appreciated. Thanks!

**Tags:** assets, css, s3

---

## 1 answers

### Answer by username_1 on 2015-12-23. Score: 5 | Accepted answer

This question is really more about S3 than about Craft. What you need for the assets is not the file path, but the url. And yes, S3 assets do have a url. This page describes the format for the host:
.s3-website-.amazonaws.com

They give these examples:

This URL requests the photo.jpg object, which is stored at the root level in the bucket.

http://examplebucket.s3-website-us-east-1.amazonaws.com/photo.jpg


This URL requests the docs/doc1.html object in your bucket.

http://examplebucket.s3-website-us-east-1.amazonaws.com/docs/doc1.html

> **Comments:**
> **username_0**: I feel silly having asked now. Thank you for clarifying that!  
> **username_2**: I'd recommend setting setting up a CNAME in your DNS to point to S3 instead of grabbing it directly (basically mapping your bucket to something like ``cdn.whatever.com``). That gives you some flexibility if you ever need to cut AWS out of the picture or change datacenters within AWS.  

---

