<p>In your Control Panel, go to <strong>Settings > General</strong>.</p>

<p>Then set your Site URL to <code>{siteUrl}</code>.</p>

<p>This will parse out the <code>siteUrl</code> environment variable. For more information, see <a href="https://craftcms.stackexchange.com/a/913/45">this thread...</a></p>

CC BY-SA 3.0
2014-08-11T08:41:45.993Z
2014-08-11T08:51:13.907Z
2017-04-13T12:51:00.253Z
Lindsey D
<p>In my general.php file I have a siteUrl environment variable declared:</p>

<pre><code>'ontherocks.dev' =&gt; array(
    'devMode' =&gt; true,
    'environmentVariables' =&gt; array(
        'siteUrl'  =&gt; 'http://local.ontherocks.dev/',
    )      
),

'dev.livesite.com' =&gt; array(

    'environmentVariables' =&gt; array(
        'siteUrl'  =&gt; 'http://dev.livesite.com/',
    )       
)
</code></pre>

<p>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?</p>

<config><control-panel><siteurl>
Environment Variable siteURL ignored
# Environment Variable siteURL ignored

(Asked by: username_0 on 2014-08-11)

In my general.php file I have a siteUrl environment variable declared:
'ontherocks.dev' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'siteUrl'  => 'http://local.ontherocks.dev/',
    )      
),

'dev.livesite.com' => array(

    'environmentVariables' => array(
        'siteUrl'  => 'http://dev.livesite.com/',
    )       
)

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?

**Tags:** config, control-panel, siteurl

---

## 1 answers

### Answer by username_1 on 2014-08-11. Score: 7 | Accepted answer

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...](https://craftcms.stackexchange.com/a/913/45)


---

