2016-02-05 119 views
0

我們在Magento商店中有3個網站。 這是我所做的。Magento不斷重定向到多站點商店的默認網站

  1. 我已經下載從活動網站的代碼,以我的本地機器
  2. 建立虛擬主機的3個網站

    created site1(2 & 3).com.conf and enabled them 
    
  3. 添加相應的行到/ etc/hosts中
  4. 在我的.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),因爲我的機器上週格式化了。

感謝,

回答

0

看來我的Apache配置有問題。

SetEnvIf Host returns an empty value 

我切換到我的每一個虛擬主機

SetEnv MAGE_RUN_CODE "site1" 
SetEnv MAGE_RUN_TYPE "website" 

本地和生產之間的唯一區別的設置值是Apache的版本2.4在本地和2.2生產

0

是否更改網址爲每個website.Please檢查core_config_data表也可以在管理員修改。

admin->system->configuration->general->web->(Secure and unsecure Url) 
+0

這些都是相同的URL我在現場服務器中。我保留了一切。我認爲這與我的配置有關,但我無法弄清楚究竟是什麼。 – Ali