Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my general.php file I have a siteUrl environment variable declared:

'' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'siteUrl'  => '',

'' => array(

    'environmentVariables' => array(
        'siteUrl'  => '',

But when calling it on my page to get page url: siteUrl ~ entry.url siteUrl is appearing as it is defined in the Craft CMS General Settings SiteUrl. Is it possible for the environment variable to take precedence?

share|improve this question
up vote 6 down vote accepted

In your Control Panel, go to Settings > General.

Then set your Site URL to {siteUrl}.

This will parse out the siteUrl environment variable. For more information, see this thread...

share|improve this answer
Thanks! Did the trick! – mmc501 Aug 11 '14 at 8:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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