0

We want to create one Magento store with 500 different URL's The catalog and the products would be the same, only the store logo and some CMS blocks would be different. The checkout would all go through the main store. SO for example, the main store would be www.mainstore.com we would also have www.store1.com with it's own logo and header banner - www.store2.com with it's own logo and header banner.

We don't want to use Magento store views functionality because of the affect on the database, it would create a new index for each storeview.

Is there any other way to accomplish this?

1 Answer 1

2

Yes, you can.

One solution that came fist that involves little backend and not little frontend and do not preserve the domain after clicking links is:

  1. In the administration - disable the field "Auto-redirect to Base URL" from the URL Options section in System > Configuration > Web
  2. Create simple module with helper which contains a method, for the example with name formatStrByDomain, that transforms string such as foo_%s_bar to foo_store1com_bar

In header.phtml you can replace <?php echo $this->getLogoSrc() ?> with something like this:

<?php echo Mage::getBaseUrl('media') . '/wysiwyg/logos/' . Mage::helper('mymodule/myhelper')->formatStrByDomain('logo_%s_.png'); ?>

And then in an editor from the admin in the image gallery you can create folder named 'logos' and upload a logo with name logo_store1com.png which will be used on the domain store1.com

Similar to this you can change cms blocks from the layout or directly from the template from which the cms block is called.

From the layout (The prefered way):

instead of

<block type="cms/block" name="cms_block.some_cms_block_from_layout">
    <action method="setBlockId">
        <identifier>some_cms_block_from_layout</identifier>
    </action>
</block>

you will: %s_some_cms_block_from_layout

From template files:

instead of

<?php echo $this->getChildHtml('some_cms_block_from_layout'); // or creating and outputing cms block ?>

You will:

<?php 
$someCmsBlock = $this->getChildHtml('some_cms_block_from_layout'); // or creating a cms block
$someCmsBlock->setBlockId(Mage::helper('mymodule/myhelper')->formatStrByDomain('%s_some_cms_block_identifier'));
?>

And create a cms block(s) in the admin with identifier which looks like store1com_some_cms_block_identifier

It's up to you how you will manage the domains (through cpanel I suppose)

5
  • thanks MrHellish! if I point store.com and store2.com to the root domain that should be enough, no? But what would a visitor to the site see? store1.com or systemurl.com?
    – Haim
    May 16, 2016 at 17:51
  • Yes, you can point them but not with redirect, but with A record. The visitor will see the site which he opens.
    – MrHellish
    May 16, 2016 at 20:36
  • And when he goes to a product page from the home page what will the URL be?
    – Haim
    May 16, 2016 at 20:36
  • Will be the system one, but check out this solution: stackoverflow.com/a/14835697
    – MrHellish
    May 18, 2016 at 10:53
  • What if we developed a module that would duplicate Magento functionality that allows for a different base URL per store view, without creating index and catalog tables for each store view? is that even possible?
    – Haim
    May 19, 2016 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.