I tried this and no change. I can see to get it to redirect all URLs to only one page:
switch ($HTTP_HOST) {
case "/domain2/":
header("Location: /domain2.com/index.php");
break;
case "/domain3/":
header("Location: /domain3/index.php");
break;
default:
header("Location: /index2.php");
};