I'm using the following multi-env config. My dev config works as expected. However, when I visit my staging site, it is setting the siteUrl to the production Url
<?php
// Dev URL
$devUrl_au = "au-site.dev";
$devUrl_nz = "nz-site.dev";
$devUrl_us = "us-site.dev";
// Testing URL
$testUrl_au = "test.site.com.au";
$testUrl_nz = "test.site.nz";
$testUrl_us = "test.site.co";
// Production URL
$liveUrl_au = "site.com.au";
$liveUrl_nz = "site.nz";
$liveUrl_us = "site.co";
return [
/***************************
GLOBAL CONFIGURATION
***************************/
'*' => [
'environmentVariables' => [
'assetUrl' => '/',
],
'doAnalytics' => false,
'omitScriptNameInUrls' => 'auto',
'enableCsrfProtection' => true,
'siteRoutesSource' => 'file',
],
/***************************
DEVELOPMENT
***************************/
'.dev' => [
'devMode' => true,
'enableTemplateCaching' => false,
],
$devUrl_au => [
'siteUrl' => [ 'en_au' => 'http://' . $devUrl_au . '/',],
],
$devUrl_nz => [
'siteUrl' => [ 'en_nz' => 'http://' . $devUrl_nz . '/', ],
],
$devUrl_us => [
'siteUrl' => [ 'en_us' => 'http://' . $devUrl_us . '/', ],
],
/***************************
STAGING
***************************/
$testUrl_au => [
'siteUrl' => [ 'en_au' => 'http://' . $testUrl_au . '/', ],
],
$testUrl_nz => [
'siteUrl' => [ 'en_nz' => 'http://' . $testUrl_nz . '/', ],
],
$testUrl_us => [
'siteUrl' => [ 'en_us' => 'http://' . $testUrl_us . '/', ],
],
/***************************
PRODUCTION
***************************/
$liveUrl_au => [
'doAnalytics' => true,
'siteUrl' => [ 'en_au' => 'http://' . $liveUrl_au . '/', ],
],
$liveUrl_nz => [
'doAnalytics' => true,
'siteUrl' => [ 'en_nz' => 'http://' . $liveUrl_nz . '/', ],
],
$liveUrl_us => [
'doAnalytics' => true,
'siteUrl' => [ 'en_us' => 'http://' . $liveUrl_us . '/', ],
],
];