Magento Forum

   
New domain will use main domain mangento store
 
rabakana
Jr. Member
 
Total Posts:  12
Joined:  2013-03-26
 

Hi!

I have domain_main.com and domain_new.com and I’d like to show same products on both websites. Both domains are hosted at same service provider. I followed several instructions in web how to do that but all failed.

What have done so far is - I have installed Mangeto to domain_main.com, set up product catalog and created:
- new website (with code domain_new)
- new store
- new store view

Also I modified index.php in domain_main.com Magento root folder. Added right before:

Mage::run($mageRunCode$mageRunType);

the lines:

switch($_SERVER['HTTP_HOST']{
    
case 'domain_new.com':
    case 
'www.domain_new.com':
        
$mageRunCode 'domain_new';
        
$mageRunType 'website';
    break;
}

There should be done more because if I go http://www.domain_new.com then I get same “under construction” message as before. I’d like that Mageto website from domain_main.com will be opened with new store. What I am missing? Shoud I change in domain_new.com some settings?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hxd
Sr. Member
 
Avatar
Total Posts:  224
Joined:  2011-02-03
 

On your hosting account where Magento is installed (using your example that would be the one corresponding to domain_main.com) you also need to park the other domain (domain_new.com). You can do that from the control panel of the hosting account. Assuming that your hosting provider uses cPanel for managing hosting accounts, then there\’s a section there for parking domains.

The change in the index.php file seems fine, as long as the website code for the second domain is the same as you have added it from the admin panel of Magento. Since you want both shops to share the same catalog you have to make sure that the store for the second website uses the same root category as the first store (you can check from the admin panel from System>Manage Stores).

You also have to do a few more things from the admin panel. Go to System>Configuration, from the Current Configuration Scope drop-down menu in the upper left corner select the website for the second domain.

After that on the same page click on the Web tab on the left, expand the Unsecure panel on the right and change the Base URL option so that it points to the second domain; just type the full URL (e.g. http://domain_new.com). Also set the base url in the Secure panel (e.g. https://domain_new.com).

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top