1

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?

1 Answer 1

2

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

1
  • Ah, the '*' key is what I was missing... (no typo in my actual code). Thanks @brad!
    – strandall
    Commented Aug 31, 2016 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.