Answers.Body: <p>I found the solution after a lot of poking and prodding:</p>
  <pre><code>'aliases' =&gt; [
      '@assetBaseUrl' =&gt; '/distribution/assets/',
      '@assetBasePath' =&gt; '/path/to/the/assets/',
  ],
  </code></pre>
  <p>Added into the general.php file in config did the magic.</p>
  <p>I still needed to alias the imager folder but all seems to be working well now in a sub-folder.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-26T17:50:10.710Z
Answers.LastActivityDate: 2021-08-26T17:50:10.710Z
Answers.UserDisplayName: steve
Body: <p>Unusual use-case - but I have a client with two websites they're merging into one. Their aim is to make the Craft 3 site (currently on its own top level domain) run in a /distribution sub folder.</p>
  <p>I've managed to get this largely working by using the apache alias command:</p>
  <pre><code>Alias /distribution &quot;/path/to/craftsite/web/&quot;
  </code></pre>
  <p>and updating the site .env and config file to have the /distribution/ folder on the end of the <code>DEFAULT_SITE_URL</code>.</p>
  <p>The site now loads but struggles loading CSS, JS and images as it's looking for these at the higher level than the /distribution folder which is aliased.</p>
  <p>Is there an easy way to add a prefix to the path Craft is loading all the assets from?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-26T15:58:10.803Z
Comments.Text: Is this about the public assets or the cpresources for the backend?
Comments.UserDisplayName: Max Strebel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-26T16:43:43.520Z
Comments.Text: Public assets so far (I may yet encounter issues with cpresources further through testing though...).
Comments.UserDisplayName: steve
Tags: <assets><subfolder><alias>
Title: Craft site in subfolder of domain
ThreadText: # Craft site in subfolder of domain
  
  (Asked by: username_0 on 2021-08-26)
  
  Unusual use-case - but I have a client with two websites they're merging into one. Their aim is to make the Craft 3 site (currently on its own top level domain) run in a /distribution sub folder.
  
  I've managed to get this largely working by using the apache alias command:
  
  ```
  Alias /distribution "/path/to/craftsite/web/"
  
  ```
  
  and updating the site .env and config file to have the /distribution/ folder on the end of the `DEFAULT_SITE_URL`.
  
  The site now loads but struggles loading CSS, JS and images as it's looking for these at the higher level than the /distribution folder which is aliased.
  
  Is there an easy way to add a prefix to the path Craft is loading all the assets from?
  
  **Tags:** assets, subfolder, alias
  
  > **Comments:**
  > **username_1**: Is this about the public assets or the cpresources for the backend?  
  > **username_0**: Public assets so far (I may yet encounter issues with cpresources further through testing though...).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-08-26. Score: 1 | Accepted answer
  
  I found the solution after a lot of poking and prodding:
  
  ```
  'aliases' => [
      '@assetBaseUrl' => '/distribution/assets/',
      '@assetBasePath' => '/path/to/the/assets/',
  ],
  
  ```
  
  Added into the general.php file in config did the magic.
  
  I still needed to alias the imager folder but all seems to be working well now in a sub-folder.
  
  
  ---
  
  