PHP Magento Tips

How to Set up Multiple Websites in Magento

Rate this posting:
{[['']]}

To add Multiple Website in Magento, Go to admin panel in System >> Manage Stores.

First Create website:

Give Name, Code, Sort Order and Choose your Default Store.

Crete Store:


Choose website, Give Store name, Select root Category (as default category) and select your default store view.

Create Store View:

Choose your store, Give name (e.g. English), Give Code (e.g. your_Store_en), select status (Enabled) and give sort order.

Above are very easy steps. After completing above step create one directory. Check your code name which you gave when creating a website. and give this name to your newly created directory in your Magento root.

Now copy your .htacess and index.php file from your Magento root and paste into this newly created directory.

Now open your index.php file and change file path for includes/config.php, app/Mage.php and app/bootstrap.php as per below.

$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';

$mageFilename = MAGENTO_ROOT . '/../app/Mage.php';

require MAGENTO_ROOT . '/../app/bootstrap.php';

Update your $mageRunCode and $mageRunType variable as per below:

$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'your_website_code';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';

Mage::run($mageRunCode, $mageRunType);

Go to System >> Configuration in that go to General >> Web. From Left top corner under Current Configuration Scope and select your website.

Now change base URL for your new website (give name as http://yoursite.com/website_code/).

If you want more customization then also change skin, Media and Javascript folder path. It is not necessary, but you must check that you provide correct path {{secure_base_url}} for your website otherwise your website skin,media and JS folder path will not found and at Front End you can't see your Page Properly.

Now go to CMS >> Pages and Create a New Home page for your New website.

In that select Store view from your new website's store view and save page.

Now go to front end and type your website (e.g. http://yoursite.com/website_code/), you will find your new Homepage content for your new website.
Tag : Magento
0 Comments On "How to Set up Multiple Websites in Magento"

Back To Top