So I have this example database config setup
$customDbConfig = array(
'*' => array(
'tablePrefix' => 'craft',
),
'test1.foo.com' => array(
'server' => 'localhost',
'user' => 'test1user',
'password' => '',
'database' => '',
),
'test2.foo.com' => array(
'server' => 'localhost',
'user' => 'test2user',
'password' => '',
'database' => '',
),
'foo.com' => array(
'server' => 'localhost',
'user' => 'produser',
'password' => '',
'database' => '',
),
);
It appears that when accessing test1.foo.com, the foo.com environment is being loaded.
Looking at the docs again
When Craft is comparing your config keys with $_SERVER['SERVER_NAME'], it’s only looking for a partial match. So the environment key 'example.com' will also work if you’re accessing your site via www.example.com or any other subdomain. You could even just use the TLD if you’re feeling adventurous:
What's the best way to get around this issue, where we want subdomains for dev and test, when they are subdomains of the production domain.
Thanks.