【发布时间】:2016-05-15 08:36:01
【问题描述】:
我们在 Magento 商店中有 3 个网站。 这就是我所做的。
- 我已将代码从实时站点下载到本地计算机
-
为 3 个网站设置虚拟主机
created site1(2 & 3).com.conf and enabled them - 在 /etc/hosts 中添加了相应的行
-
在我的 .htaccess 中,我有管理 3 个网站的代码
SetEnvIf Host www\.site1\.com MAGE_RUN_CODE=site1 SetEnvIf Host www\.site1\.com MAGE_RUN_TYPE=website SetEnvIf Host ^site1\.com MAGE_RUN_CODE=site1 SetEnvIf Host ^site1\.com MAGE_RUN_TYPE=website SetEnvIf Host www\.site2\.com MAGE_RUN_CODE=site2 SetEnvIf Host www\.site2\.com MAGE_RUN_TYPE=website SetEnvIf Host ^site2\.com MAGE_RUN_CODE=site2 SetEnvIf Host ^site2\.com MAGE_RUN_TYPE=website SetEnvIf Host www\.site3\.com MAGE_RUN_CODE=site3 SetEnvIf Host www\.site3\.com MAGE_RUN_TYPE=website SetEnvIf Host ^site3\.com MAGE_RUN_CODE=site3 SetEnvIf Host ^site3\.com MAGE_RUN_TYPE=website
在实时服务器上一切正常,但在我的本地计算机上,当我键入 www.site1.com 或 www.site2.com 时,我会自动重定向到 www.site2.com,因为它是默认网站。
我在 Ubuntu 14.04 上我刚刚设置了整个环境(apache2、php5、mysql),因为我的机器上周已格式化。
谢谢,
【问题讨论】:
标签: apache .htaccess magento ubuntu-14.04