Answers.Body: <p>Assuming this is using Craft 3, you should <a href="https://docs.craftcms.com/v3/config/#aliases" rel="nofollow noreferrer">use aliases</a>.</p>
  
  <p>In your <code>config/general.php</code> add:</p>
  
  <pre><code>'aliases' =&gt; [
      'web' =&gt; 'https://site.com',
      'webroot' =&gt; dirname(__DIR__) . '/web'
  ],
  </code></pre>
  
  <p>Then in your Control Panel, under Settings → Assets → Images, set your <strong>Base URL</strong> to <code>@web/images</code> and <strong>File System Path</strong> to <code>@webroot/images</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-17T13:05:14.183Z
Answers.Text: Thank you so much Oli, this resolved the issue.
Answers.UserDisplayName: simthesecond
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-17T12:34:41.133Z
Answers.LastActivityDate: 2020-04-17T12:34:41.133Z
Answers.UserDisplayName: Oli
Body: <p>just built a blog with craft, and I got some issues with assets pathing.
  In the general.php I put</p>
  
  <pre><code>return array(
      'environmentVariables' =&gt; array(
              'basePath' =&gt; '/images',
              'baseUrl'  =&gt; 'https://site.com',
          )
  );
  </code></pre>
  
  <p>But when I put {basePath} to assets path, the system creates a {basePath} named folder in root and looks for the image folder there. Also the {baseUrl} is looking like this in the code:</p>
  
  <p><code>https://site.com/{baseUrl}/images/image.jpg</code></p>
  
  <p>Am I doing something wrong?</p>
  
Tags: <assets>
Title: {basePath} creates a folder named {basePath} issue
ThreadText: # {basePath} creates a folder named {basePath} issue
  
  (Asked by: username_0 on 2020-04-17)
  
  just built a blog with craft, and I got some issues with assets pathing.
  In the general.php I put
  
  ```
  return array(
      'environmentVariables' => array(
              'basePath' => '/images',
              'baseUrl'  => 'https://site.com',
          )
  );
  
  ```
  
  But when I put {basePath} to assets path, the system creates a {basePath} named folder in root and looks for the image folder there. Also the {baseUrl} is looking like this in the code:
  
  `https://site.com/{baseUrl}/images/image.jpg`
  
  Am I doing something wrong?
  
  **Tags:** assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-17. Score: 3 | Accepted answer
  
  Assuming this is using Craft 3, you should [use aliases](https://docs.craftcms.com/v3/config/#aliases).
  
  In your `config/general.php` add:
  
  ```
  'aliases' => [
      'web' => 'https://site.com',
      'webroot' => dirname(__DIR__) . '/web'
  ],
  
  ```
  
  Then in your Control Panel, under Settings → Assets → Images, set your **Base URL** to `@web/images` and **File System Path** to `@webroot/images`.
  
  > **Comments:**
  > **username_0**: Thank you so much Oli, this resolved the issue.  
  
  ---
  
  