One of Magento’s great features is the multi-site & multi-store capabilities. If you’re new to Magento, this means that you can run more than one website from the same Magento installation. Having just added yet another website to a client’s Magento installation, I thought I’d jot the steps down as an aide-mémoire. So below I’m going to outline a checklist of the actions required to set up a mutli-website store in Magento.
For the purposes of the this example, assume I already have a Mage website eddiemay.me.uk and want to add another website eddie-may.com. Also assume that I’m selling to the same country with the same Tax & shipping rules, payment gateway, etc. Also assume that I’m going to be using the same template but use a different skin to make it look different.
NB: This example is for Magento Community Edition 184.108.40.206 – earlier editions had different ways of routing requests using .htaccess or index.php.
- Buy a multi-domain SSL certificate. Make sure that new domain is associated with this certificate.
- Point your new domain name at your server.
- Log into Magento and do a backup – peace of mind, etc.
- Set up a new root category & then add any sub categories as required. This root category is going to be ‘home’ of the new website.
- Go to System/Manage Stores. Next, hit the Create Website button & fill in the necessary information – keep a note of the value you put in the “code” field. In my example I’m going to use “may” as the code value.
- Repeat the steps for Create Store & Create Store View. When you create a store you set the root category to be the one you’ve just created in step 4 above.
- Go to CMS/Pages and create a new home page & associate it with the new Website.
- Now go to System/Configuration and change the ‘Current Configuration Scope’ to your new website. You’ll notice that the values are a copy of the default website. You’re now going to have to go through a number of tabs and change the required values. Here I’ll refer only to the essential changes.
- Under System/Configuration/Web change the Secure & Unsecure urls to your new domain name – in this case eddie-may.com. Also under Default Pages set the CMS Home Page to the page you created in step 7. Under the Session Cookie Management tab, add your new domain as the Cookie Domain like so -> .eddie-may.com
- In the Design tab you now have a choice of determining how the website will look. Here I’m going to assume that you’ll use the same template but use CSS to change the style of the site.
- So, upload a new skin under the /skin/frontend/default. Lets assume the new skin is called eddiemay, that means you’ll have a folder like so /skin/frontend/default/eddiemay
- If that’s the case, the design settings will be Package = default; Skin (Images/CSS) = eddiemay; Layout & Default will be the same values as your first website.
- Still under the Design tab, change the HTML Head, Header, Footer, etc as required. From an SEO perspective, make sure that the Default Title & Description are unique.
- Now go to Store Emails – you’ll need to change email addresses to reflect the new domain name. Make sure that these email accounts actually exist before going live.
- Under Contacts change the main contact email as required.
- Under Sales/Invoice & Packing Slip Design – change the default logos to your new logo.
- Under Sales/Sales Emails – you may have to change the email templates if you’ve heavily customised your default email templates (you may have hardcoded your store name, for example).
- That’s more or less it for the System/Configuration settings.
- Now go to CMS section. Here you may have to create new CMS pages & Static Blocks, or at least associate existing ones with the new website. At a minimum you’ll need to associate the Contact, About, Privacy, Terms, Shipping pages with the new website.
- The next thing you’ll need to do is add the new website to your .htaccess file. You need to add the new domain like so:
## multidomain SetEnvIf Host www\.eddiemay\.me.uk MAGE_RUN_CODE=base SetEnvIf Host www\.eddiemay\.me.uk MAGE_RUN_TYPE=website SetEnvIf Host ^eddiemay\.me.uk MAGE_RUN_CODE=base SetEnvIf Host ^eddiemay\.me.uk MAGE_RUN_TYPE=website
SetEnvIf Host www\.eddie-may\.com MAGE_RUN_CODE=may SetEnvIf Host www\.eddie-may\.com MAGE_RUN_TYPE=website SetEnvIf Host ^eddie-may\.com MAGE_RUN_CODE=may SetEnvIf Host ^eddie-may\.com MAGE_RUN_TYPE=website
- You’ll notice that I’ve used the code “may” – this was the value I entered in the new Website code field in step 5 above.
- Upload the new .htaccess file.
- Now test your new website – chances are that you’ll get an error. Downloading the error report will give a cryptic “SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘database-name.catalog_category_flat_store_3′” doesn’t exist – or something similar. If this happens, log into your Magento administration UI, go to System/Index Management & you’ll probably see that several indexes need re-indexing. Once complete, your website should now work as expected.
- If all is good, its now time to add some products. You could copy products over from the original website but personally I’d create them from scratch or upload new ones. This is because you can then optimise their descriptions, etc., to avoid duplicate content penalties, etc.
Well, I think that covers all the bases. This will probably take you about 2 hours to complete, depending on the amount of customising of Email template, Static Blocks, etc. The CSS customisations are another thing altogether.
If I’ve left anything out, please let me know. Either way, I hope you find it useful.