Answers.Body: <p>When you're creating a new local asset volume, you choose a file system path. I use both the site handle and the section handle in the path. For example:</p>
  
  <pre><code>/assets/&lt;SiteHandle&gt;/images/&lt;SectionHandle&gt;
  </code></pre>
  
  <p>Or, referencing your example (and using 'blog' as a section in your site):</p>
  
  <pre><code>/assets/site1/images/blog
  </code></pre>
  
  <p>I find that it's important to divide up the assets this way so that if you need to migrate content or backup, it will be much easier to figure out which assets go with which content.</p>
  
  <p>If the sites share images in common (eg. social icons), I usually make a common folder to hold these above the site level in assets:</p>
  
  <pre><code>/assets/common/images
  </code></pre>
  
  <p>But I ultimately recommend that instead of local storage, you use Amazon S3 Buckets. It's relatively simple to set up and you'll see much better performance from Amazon's CDNs. You can use this same concept outlined for local files on Amazon S3.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-23T19:50:41.260Z
Answers.Text: How do you add in the <SiteHandle> like that? Are there hardcoded asset volumes for each Site or is there a way to echo it out? Can't seem to figure it out using @aliases or {twigvars}.
Answers.UserDisplayName: Rob Erskine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-27T04:04:57.237Z
Answers.LastActivityDate: 2018-12-27T04:04:57.237Z
Answers.UserDisplayName: Vaughn D. Taylor
Answers.Body: <p>I had the same question and here is a way to have assets in separate root folders using aliases with Site handles: <a href="https://craftcms.stackexchange.com/questions/33278/how-do-i-dynamically-define-asset-volumes-base-urls-for-different-sites/33284#33284">How do I dynamically define Asset Volumes&#39; Base URLs for different Sites?</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T16:05:04.033Z
Answers.LastActivityDate: 2019-12-17T16:05:04.033Z
Answers.UserDisplayName: Kirk Roberts
Body: <p>I have a setup with multi sites that are separate domains. </p>
  
  <p>site-a.com </p>
  
  <p>site-b.com</p>
  
  <p>I would also like to have assets separate for each site, like so:</p>
  
  <p>site-a.com/images/picture1.jpg</p>
  
  <p>site-b.com/images/picture2.jpg</p>
  
  <p>I tried setting up aliases for each site, but just couldn't get it to work.
  Managed to get only one set of aliases to work, in the general.php file, under '*'.
  But cannot get aliases to be different for each site, like @web for example.</p>
  
  <p>How would i setup the general.php or volumes.php or env.php to have separate assets for each site?</p>
  
  <p>Additional notes: </p>
  
  <p>I am using the latest version of Craft 3 (Craft CMS 3.0.23.1).</p>
  
  <p>PHP 7.2</p>
  
  <p>The setting "Propagate entries across all enabled sites?" in section is enabled.</p>
  
  <p>The setting "Manage relations on a per-site basis" for asset field is enabled.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-19T01:03:44.733Z
Comments.Text: Have you tried setting the asset paths to just /images ?
Comments.UserDisplayName: Chattervast
Tags: <assets><craft3><multi-site><multi-domain>
Title: How to setup assets in multi site where each site should have its own assets?
ThreadText: # How to setup assets in multi site where each site should have its own assets?
  
  (Asked by: username_0 on 2018-09-07)
  
  I have a setup with multi sites that are separate domains.
  
  site-a.com
  
  site-b.com
  
  I would also like to have assets separate for each site, like so:
  
  site-a.com/images/picture1.jpg
  
  site-b.com/images/picture2.jpg
  
  I tried setting up aliases for each site, but just couldn't get it to work.
  Managed to get only one set of aliases to work, in the general.php file, under '\*'.
  But cannot get aliases to be different for each site, like @web for example.
  
  How would i setup the general.php or volumes.php or env.php to have separate assets for each site?
  
  Additional notes:
  
  I am using the latest version of Craft 3 (Craft CMS 3.0.23.1).
  
  PHP 7.2
  
  The setting "Propagate entries across all enabled sites?" in section is enabled.
  
  The setting "Manage relations on a per-site basis" for asset field is enabled.
  
  **Tags:** assets, craft3, multi-site, multi-domain
  
  > **Comments:**
  > **username_1**: Have you tried setting the asset paths to just /images ?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-12-27. Score: 3
  
  When you're creating a new local asset volume, you choose a file system path. I use both the site handle and the section handle in the path. For example:
  
  ```
  /assets/<SiteHandle>/images/<SectionHandle>
  
  ```
  
  Or, referencing your example (and using 'blog' as a section in your site):
  
  ```
  /assets/site1/images/blog
  
  ```
  
  I find that it's important to divide up the assets this way so that if you need to migrate content or backup, it will be much easier to figure out which assets go with which content.
  
  If the sites share images in common (eg. social icons), I usually make a common folder to hold these above the site level in assets:
  
  ```
  /assets/common/images
  
  ```
  
  But I ultimately recommend that instead of local storage, you use Amazon S3 Buckets. It's relatively simple to set up and you'll see much better performance from Amazon's CDNs. You can use this same concept outlined for local files on Amazon S3.
  
  > **Comments:**
  > **username_3**: How do you add in the <SiteHandle> like that? Are there hardcoded asset volumes for each Site or is there a way to echo it out? Can't seem to figure it out using @aliases or {twigvars}.  
  
  ---
  
  ### Answer by username_4 on 2019-12-17. Score: 1
  
  I had the same question and here is a way to have assets in separate root folders using aliases with Site handles: [How do I dynamically define Asset Volumes' Base URLs for different Sites?](https://craftcms.stackexchange.com/questions/33278/how-do-i-dynamically-define-asset-volumes-base-urls-for-different-sites/33284#33284)
  
  
  ---
  
  