Answers.Body: <p>Your <code>config/general.php</code> file code has some problem with it.</p>
  
  <p>You're missing a closing <code>)</code> for an array, which I suspect is a typo, but the issue to your real problem is probably the fact you're missing the required <code>'*'</code> key for multi-environment configs to work properly.</p>
  
  <p>See the first warning note on this page: <a href="https://craftcms.com/docs/multi-environment-configs" rel="nofollow">https://craftcms.com/docs/multi-environment-configs</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-31T18:37:25.680Z
Answers.Text: Ah, the `'*'` key is what I was missing... (no typo in my actual code). Thanks @brad!
Answers.UserDisplayName: strandall
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-26T04:21:50.717Z
Answers.LastActivityDate: 2016-08-26T04:21:50.717Z
Answers.UserDisplayName: Brad Bell
Body: <p>I have my general config file set up as follows:</p>
  
  <pre><code>return array(
    'localhost' =&gt; array(
    'devMode' =&gt; true,
    'environmentVariables' =&gt; array(
      'baseUrl' =&gt; 'http://localhost:8888/path/to/site/'
    )
   );
  </code></pre>
  
  <p>Then, I have an asset source set up as follows:</p>
  
  <pre><code>File Base Path: assets/img/general/
  URL: {baseUrl}assets/img/general/
  </code></pre>
  
  <p>The assets pulled within a template get this error: </p>
  
  <pre><code>GET http://localhost:8888/path/to/site/%7BbaseUrl%7Dassets/img/headers/image.jpg 404 (Not Found)
  </code></pre>
  
  <p>I've used this format with several other sites before, and haven't had a problem. Does anyone have any suggestions?</p>
  
Tags: <templating><assets><404><environmentvariables>
Title: Environmental variable coming back as literal braces
ThreadText: # Environmental variable coming back as literal braces
  
  (Asked by: username_0 on 2016-08-25)
  
  I have my general config file set up as follows:
  
  ```
  return array(
    'localhost' => array(
    'devMode' => true,
    'environmentVariables' => array(
      'baseUrl' => 'http://localhost:8888/path/to/site/'
    )
   );
  
  ```
  
  Then, I have an asset source set up as follows:
  
  ```
  File Base Path: assets/img/general/
  URL: {baseUrl}assets/img/general/
  
  ```
  
  The assets pulled within a template get this error:
  
  ```
  GET http://localhost:8888/path/to/site/%7BbaseUrl%7Dassets/img/headers/image.jpg 404 (Not Found)
  
  ```
  
  I've used this format with several other sites before, and haven't had a problem. Does anyone have any suggestions?
  
  **Tags:** templating, assets, 404, environmentvariables
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-08-26. Score: 2 | Accepted answer
  
  Your `config/general.php` file code has some problem with it.
  
  You're missing a closing `)` for an array, which I suspect is a typo, but the issue to your real problem is probably the fact you're missing the required `'*'` key for multi-environment configs to work properly.
  
  See the first warning note on this page: <https://craftcms.com/docs/multi-environment-configs>
  
  > **Comments:**
  > **username_0**: Ah, the `'*'` key is what I was missing... (no typo in my actual code). Thanks @username_1!  
  
  ---
  
  