I found that it wasn't picking the correct domain to use when trying to set it up by content type.
eg

domain 'fred.domain.com' set to be used for content type 'fred'
domain 'bob.domain.com' set to be used for content type 'bob'

Instead, it was just using the first domain.

Fixed it by changing:

$page_match = $page_match || in_array($node->type, array_keys($info['types']));

to

$page_match = $page_match || in_array($node->type, array_keys($info['types'],!"0"));

Seems to work now!

Comments

druvision’s picture

Try the following use-case:

First check several relevant content types, then un-check them.

The $info['types'] array (and the multidomain_sites variable on the variable table) will still contain numeric entities for the unchecked domains.

Conclusion: there is a bug in the content type selection mechanism.

druvision’s picture

Continued:

On my case the array contained two extra entities - '0' and '1'.

Workaround: When I've deleted the relevant domain and re-added it, the array was OK and hence not every URL was routed to the domain, just the relevant ones.

druvision’s picture

Status: Needs review » Active