What exactly do I have to change in the index.php om DomainB and what else should I do to make it work?
There are two lines located in the index.php of all of your ‘non-main domains’:
1. The very last line of index.php will be change to something similar to this:
2. Also in index.php adjust the path to your main domains Mage.php (if you have problems double check with your host that you know the right path for the website).
$mageFilename = ‘/var/www/vhosts/domain1.com/httpdocs/shop/app/Mage.php’;
I know that there are many posts about multi-sites and that it can get confusing. Personally I believe that Crucial has put together the best explanation on the subject:
Crucial link to multi-website blog