<p>You can't append anything to the value if you use environment variables. You need to use <a href="https://craftcms.com/docs/3.x/config/#aliases" rel="nofollow noreferrer">aliases</a> for this.</p>
<p>In you <em>config/general.php</em>, add this:</p>
<pre class="lang-php prettyprint-override"><code>'*' =&gt; [
    'aliases' =&gt; [
        'assetBasePath' =&gt; getenv('ASSET_BASE_PATH'),
        'assetBaseUrl' =&gt; getenv('ASSET_BASE_URL'),
    ],
],

</code></pre>
<p>Then in the asset volume settings, use the aliases in the <strong>Base URL</strong> &amp; <strong>File system path</strong>:</p>
<p><a href="https://i.sstatic.net/2h0dd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2h0dd.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2020-09-21T12:12:12.827Z
Thx, updated as suggested but it still creates a folder at web root titled /public_html/@assetPath/sub_folders_etc
stuartmcd69
CC BY-SA 4.0
2020-09-21T08:37:45.040Z
2020-09-22T09:33:19.797Z
2020-09-22T09:33:19.797Z
nstCactus
<p>For my future self, the aliases mention by nstCactus are required to reside within the <code>'*'</code> global setting area of general.php</p>
<pre><code>'*' =&gt; [
    'defaultWeekStartDay' =&gt; 1,
    'cpTrigger' =&gt; 'admin',
    …
    'aliases' =&gt; [
    …
    …
    ]
]
</code></pre>

CC BY-SA 4.0
2020-09-21T13:54:13.620Z
2020-09-21T13:54:13.620Z
stuartmcd69
<p>OK,
So created 2 variables in my local .env file</p>
<p><code>ASSET_BASE_URL=&quot;https://mysite.local/resources&quot;</code></p>
<p><code>ASSET_BASE_PATH=&quot;/Volumes/yada/yada/yada/resources&quot;</code></p>
<p>Then in the CP, created a new Asset volume and punched in</p>
<p><code>Base URL = $ASSET_BASE_URL/gallery</code></p>
<p><code>File System Path = $ASSET_BASE_PATH/gallery</code></p>
<p>Then front end renders an entries asset as:</p>
<p><code>&lt;img src=&quot;$ASSET_BASE_URL/_480x480_crop_center-center_80_none/doddle-01.jpg&quot; alt=&quot;Doddle 01&quot; width=&quot;480&quot; height=&quot;480&quot;&gt;</code></p>
<p>THEN it creates a new folder named '$ASSET_BASE_PATH' at public site root.</p>
<p>I'm familiar with V2 it appears V3 has stepped up a bit. Could it be a Mamp issue with paths or somesuch trickery? Works if I hard code the paths as listed initially. All help greatly appreciated.</p>

<assets><multi-environment><volumes>
Enironment Variable being rendered literal
# Enironment Variable being rendered literal

(Asked by: username_0 on 2020-09-21)

OK,
So created 2 variables in my local .env file

`ASSET_BASE_URL="https://mysite.local/resources"`

`ASSET_BASE_PATH="/Volumes/yada/yada/yada/resources"`

Then in the CP, created a new Asset volume and punched in

`Base URL = $ASSET_BASE_URL/gallery`

`File System Path = $ASSET_BASE_PATH/gallery`

Then front end renders an entries asset as:

`![Doddle 01]($ASSET_BASE_URL/_480x480_crop_center-center_80_none/doddle-01.jpg)`

THEN it creates a new folder named '$ASSET\_BASE\_PATH' at public site root.

I'm familiar with V2 it appears V3 has stepped up a bit. Could it be a Mamp issue with paths or somesuch trickery? Works if I hard code the paths as listed initially. All help greatly appreciated.

**Tags:** assets, multi-environment, volumes

---

## 2 answers

### Answer by username_1 on 2020-09-21. Score: 3 | Accepted answer

You can't append anything to the value if you use environment variables. You need to use aliases for this.
In you config/general.php, add this:
'*' => [
    'aliases' => [
        'assetBasePath' => getenv('ASSET_BASE_PATH'),
        'assetBaseUrl' => getenv('ASSET_BASE_URL'),
    ],
],


Then in the asset volume settings, use the aliases in the Base URL & File system path:

> **Comments:**
> **username_0**: Thx, updated as suggested but it still creates a folder at web root titled /public_html/@assetPath/sub_folders_etc  

---

### Answer by username_0 on 2020-09-21. Score: 2

For my future self, the aliases mention by nstCactus are required to reside within the '*' global setting area of general.php
'*' => [
    'defaultWeekStartDay' => 1,
    'cpTrigger' => 'admin',
    …
    'aliases' => [
    …
    …
    ]
]


---

