How to configure Magento Multistore with addon domains?
The Magento script allows you to setup multiple stores using different domains which you would have to add as addon for your account. To setup Magento Multistore with addon domains follow this steps:
Note: This articles assumes that you have already added a domain as addon for your account
- Login the Magento administration area
- Navigate to “Catalog” -> “Manage Categories”
- Click the “Add root category” button, which could be found on the left
- On the right side for “Name” enter your addon domain. For example magentostore2.com. For “Is active” and “Is Anchor” select “yes” from the dropdown menu.
- Click the “Save Category” button
- Now navigate to “System” -> “Manage Stores”
- Click the “Create website” button.
- For “Name” use magentostore2.com (in your case your addon domain). For code use magentostore2 (or one by your choice). It is important to remember these settings as you will need them later.
- Save the website.
- Now click on the “Create Store” button.
- For website choose your magentstore2.com (your addon domain) from the dropdown menu. For “Name” you may enter “Main Store”. For “Root Category” select your addon domain again from the dropdown menu.
- Hit the “Save” button.
- Once saved, click the “Create Store View” button.
- For the “Store” select “Main Store” from the dropdown menu. For “Name” enter “English”. For the code you may use one by your choice. For “Status” select “Enabled”.
- Save the “Store View”.
- Navigate to “System” -> Configuration
- Change “Current Configuration Scope” from “Default Configu” to magentostore2.com (or your addon domain).
- From the left side menu select “Web”
- For the “Secure” and “Unsecure” sections remove the mark for “Use Default” box. It could be found next to “Base URL”. Now enter the URL for your magento store: http://magentostore2.com
(you should change that with your actual URL)
- Click the “Save Config” button.
- Access the server via SSH and navigate to your addon domain’s folder. Example
- Copy the index.php and .htaccess file of your Magento store using this command:
F cp ../index.php ../.htaccess .
- Open the index.php file which you have just copied and replace:
$mageFilename = ‘app/Mage.php’;
$mageFilename = ‘../public_html/app/Mage.php’;
Find the last line of the file:
And just before it add:
$mageRunCode = ‘Your_Code_Here’;
$mageRunType = ‘website’;
Change “Your_Code_Here” with the code you have used to create the store.
- Finally, create symbolic links to point to few directories:
ln -s ../app ./app
ln -s ../errors ./errors
ln -s ../includes ./includes
ln -s ../js ./js
ln -s ../lib ./lib
ln -s ../media ./media
ln -s ../skin ./skin
ln -s ../var ./var