There are many tutorials how to set Magento to work with multiple stores and make different domains point at each store. Since release of Magento CE 1.4.0.0-beta1 and Magento EE 1.6.0.0 it is even more easy to do.
Magento evolves
Solutions used in previous versions required developer to modify index.php file to handle different domains pointing at different stores. New index php contains following code:
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run($mageRunCode, $mageRunType);
So it checks two environmental variables and use them to start Magento runing. What does it give you? You can set now which store/website is supposed to be running under selected domain directly in virtual host definition or even htaccess.
VirtualHost solution
To benefit from this little piece of code it is enough for you to add following lines within your VirtualHost definition:
SetEnv MAGE_RUN_TYPE "website" # put here 'website' or 'store'
.htaccess solution
If you have no access to virtual host definitions, you can still try to use .htaccess for that, putting within following lines:
SetEnvIf Host .*yourhost.* MAGE_RUN_TYPE=website
Where .*yourhost.* is an regex expression matching the domain for which you want to set environmental variable.
So now you are capable of setting up your Magento multiple stores website without messing up with the core. Good luck.







