设置envif主机Magento多个商店

发布于 2025-01-08 05:43:27 字数 412 浏览 3 评论 0原文

我正在尝试安装 magento 来运行多个网站,我已经完成了大部分步骤,包括停放域。但是我不确定如何回答下面的陈述:

其中最简单的是 .htaccess 解决方案,它要求您定义以下几行:

SetEnvIf Host .*myhost.* MAGE_RUN_CODE="base";
SetEnvIf Host .*myhost.* MAGE_RUN_TYPE="website";

只需确保 .myhost. 是与域匹配的正则表达式您要为其设置环境变量。

例如,我的网站是 www.domain.com 也是 www.domain1.com,magento 安装在 domain.com 上,因此对于主机,我放置 .domain.com. 并保留运行代码以及类型、基础和网站

I am trying to get a magento installation to run multiple websites I have completed most of the steps including a parked domain. However I am unsure as to how to answer the statement below:

Easiest amongst these is .htaccess solution which requires you to define the following lines:

SetEnvIf Host .*myhost.* MAGE_RUN_CODE="base";
SetEnvIf Host .*myhost.* MAGE_RUN_TYPE="website";

Simply ensure that .myhost. is a regex expression matching the domain for which you want to set environmental variables for.

For example do my website is www.domain.com and also www.domain1.com, magento is installed on domain.com so for the host do I put .domain.com. and leave the run code and type and base and website

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贵在坚持 2025-01-15 05:43:27

您应该更改的是 MAGE_RUN_CODE 以匹配 Magento 后端管理的站点的代码。您还需要更改 myhost 位以匹配您网站的域名。

例如,如果您的网站托管在 somewebsite.com 上,并且您有两个“商店”(商店视图 A 和商店视图 B,其中“ViewA”是商店视图 A,“ViewB”是商店视图 B。)

您可以这样写以下内容:

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewA
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewB
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

假设您在 Magento 后端创建了两个不同的“站点”。如果您创建了不同的商店,则可以将“网站”替换为商店。

有关 Magento 重命名的更多信息,请访问:

http:// /www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup

What you are supposed to change is the MAGE_RUN_CODE to match the code of the site that is managed in the Magento backend. You also need to change the myhost bit match the domain name of your site.

So for example, if your site is hosted on somewebsite.com and you have two "stores" (Store View A and Store View B, Where "ViewA" is Store View A and "ViewB" is Store View B.)

You would write the following:

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewA
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewB
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

This assuming you made two different "Sites" in the Magento Backend. If you made a different store, you'd replace "website" with store.

More reading on the Magento renaming can be found here:

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文