cancel
Showing results for 
Search instead for 
Did you mean: 

multi store diffrent domains

multi store diffrent domains

Hello there,

is it possible to create multi stres using magento community, but each store with deffrent domain(not sub domain) and deffrent folder but with the same admin panel.

 

please HELP

Regards

Khatab Mustafa

6 REPLIES 6

Re: multi store diffrent domains

Hi Khatab Mustafa,

 

Yes, it's possible with single magento installation to have multi stores(websites) with different domain name.

 

Thanks 

Nirmal(nirmalkirpa@gmail.com)

Magento Freelancer

Nirmal (nirmalkirpa@gmail.com)
Magento Freelancer

Re: multi store diffrent domains

Hello, piyumishra86 is right, setting different sites under one Magento installation is possible. You can find more ingo about in Magento knowledge base http://merch.docs.magento.com/ce/user_guide/Magento_Community_Edition_User_Guide.html#store-operatio...

Was my answer helpful? You can accept it as a solution.
230+ professional extensions for M1 & M2 with free lifetime updates!

Re: multi store diffrent domains

This is possible, and you can also configure auto or manuall store switching by using third party modules, 

http://www.magentocommerce.com/magento-connect/geo-ip-store-view-switcher.html

Re: multi store diffrent domains

I have an installation running 3 websites. One is a subdomain and one is a completely different domain.

I run under Apache and it requires some lines of code added to the .htaccess file.

 

I don't think you can have it running in a different directory (as that would be a different instance of Magento). You can certainly have them all running a different design theme though so they all look totally different.

 

They can also be setup to have their own root catalog or to share the same as another website within that installation.

With the products, you can set different prices and visilibilities in each website.

 

It's very versatile and doesn't take too much setting up.

Re: multi store diffrent domains

i have the same need but can't solve it

1 magento installation and i need to create 2 different customers with their own shops ... total: 2 customers - 4 shops

should i crate vhost on apache?

how can i setup magento fo have shops accessible? with different domains?

thnx

Re: multi store diffrent domains

There are different ways to set up stores, the way you need it.

 

You can edit the index.php and add some custom code, which will be fine, if you only have two or three different domains. In case some or many more will follow, it would be easier to include a sub/domain.php where all sub/domains are listed in.

Then you need to know, how these sub/domains shall act, either as store or as website. 

<?
switch($_SERVER['HTTP_HOST']) {

case 'www.sub.domain.com':
case 'sub.domain.com':
$_SERVER["MAGE_RUN_CODE"] = "your_code_for_subdomain";
$_SERVER["MAGE_RUN_TYPE"] = "store";
break;

case 'www.domain.com':
case 'domain.com':
$_SERVER["MAGE_RUN_CODE"] = "your_code_for_domain";
$_SERVER["MAGE_RUN_TYPE"] = "store";
break;

case 'www.sub2.domain.com':
case 'sub2.domain.com':
$_SERVER["MAGE_RUN_CODE"] = "your_code_for_subdomain2";
$_SERVER["MAGE_RUN_TYPE"] = "website";
break;

case 'www.domain2.com':
case 'domain2.com':
$_SERVER["MAGE_RUN_CODE"] = "your_code_for_domain2";
$_SERVER["MAGE_RUN_TYPE"] = "website";
break;


name this subdomains.php or any name you like and integrate it in index.php like this at the end of the file:

 

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

ini_set('display_errors', 1);

umask(0);

include "subdomain/subdomains.php";

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

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

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

or add in htaccess

SetEnvIf Host www\.sub.domain\.com MAGE_RUN_CODE=your_code_for_sub/domain
SetEnvIf Host www\.sub.domain\.com MAGE_RUN_TYPE=store (or website)

for each of your sub/domains!

 

You can add vhosts in your cpanel and point all the subdomains to the directory of the base, no need to work with sym-links or c/p parts of magento folder structure into the new subdomains you will create for working with the base-shop.