使用附加域运行多个 Magento 商店 - 新 Mage::run() 参数不符合教程的预期
所以我有 BroadStore.com 和 NicheStore.com。 BroadStore.com 是我的主域名,NicheStore 已作为附加域名添加。 Magento 安装在 /public_html/ (BroadStore.com 根目录)。
我正在关注本教程用于设置所有内容,但在某个时刻它要求我:
//With the index.php file still open, replace the following line of code:
Mage::run();
//…with the following:
Mage::run('shoes', 'website');
但默认情况下,我当前的 index.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);
有什么想法吗?目前 - index.php 未经编辑,但教程的其余部分已完成 - NicheStore.com 将所有内容重定向到 BroadStore.com
所有帮助表示感谢;提前致谢。这是一款重型软件。
So I have BroadStore.com and NicheStore.com. BroadStore.com is my primary domain and NicheStore has been added as an add-on. Magento is installed in /public_html/ (BroadStore.com root).
I'm following this tutorial to get everything set up but at a certain point it requires that I :
//With the index.php file still open, replace the following line of code:
Mage::run();
//…with the following:
Mage::run('shoes', 'website');
But my current index.php has the following code instead, by default:
/* 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);
Any ideas? Currently - with index.php unedited but the rest of the tutorial followed through - NicheStore.com redirects everything to BroadStore.com
All help appreciated; thanks in advance. This is one heavy piece of software.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种方法是将底部的 index.php 更改为如下所示:
或类似的内容......可能不是最好的解决方案,但它对我有用。
One way to do it is to change the index.php at the bottom to look something like:
Or something similar ... may not be the best solution but it worked for me.
我使用了描述的方法(方法2)在这里进行我的多商店设置。要求是建立一个多商店网站,在子域 a la a.domain.com 和 b.domain.com 下为不同品牌提供不同的商店。使用 SetEnvIf 方法,在 PHP 5.3.2 和 Magento 1.7 的 Ubuntu Server 上的 Apache 2.2 下完美工作。
I used the method (method 2) described here to do my multi-store setup. The requirement was to set up a multi-store site with different stores for different brands under subdomains, a la a.domain.com and b.domain.com. Worked perfectly under Apache 2.2 on Ubuntu Server with PHP 5.3.2 and Magento 1.7 using the SetEnvIf method.