First of all, copy your /components/com_sef/joomsef.php file somewhere else as a backup.
Then edit it using your favorite text editor, and around line number 1230 there should be the following code:
if (empty($lang)) {
$lang = (isset($newVars['lang']) ? $newVars['lang'] : (isset($vars['lang']) ? $vars['lang'] : null));
}
else {
// We have a language from domain, check if it corresponds to language in SEF URL
if (isset($newVars['lang']) && ($newVars['lang'] != $lang)) {
// Domain and SEF URL languages don't match
if ($sefConfig->wrongDomainHandling == _COM_SEF_WRONG_DOMAIN_REDIRECT) {
// Redirect to correct domain
if (isset($sefConfig->jfSubDomains[$newVars['lang']])) {
$domain = $sefConfig->jfSubDomains[$newVars['lang']];
$redir = JURI::getInstance();
$redir->setHost($domain);
// Redirect
$mainframe =& JFactory::getApplication();
$mainframe->redirect($redir->toString(), '', 'message', true);
exit();
}
// No domain found, show 404
$disabled = true;
}
else {
// Show 404 page
$disabled = true;
}
}
}
Just remove the "else" part of the block, so you only leave the following code there:
if (empty($lang)) {
$lang = (isset($newVars['lang']) ? $newVars['lang'] : (isset($vars['lang']) ? $vars['lang'] : null));
}
There's currently no ETA for next JoomSEF version. You don't need to remove the modification before upgrading as the whole file will be overwritten with newer version.