可以使用子文件夹/子目录设置magento多重存储,而无需创建符号链接吗?
For example:
www.mainstore
www.mainstore/store1
www.mainstore/store2
www.mainstore/store3
由于安全原因,一些托管服务提供商已禁用符号链接,正常方法是为magento root foolder中的每个商店创建一个文件夹,将其复制到index.php和.htaccess中,并将符号链接添加到所有其他magento文件夹,像这样:
ln -s /home/example/example.com/html/app/ app
ln -s /home/example/example.com/html/includes/ includes
ln -s /home/example/example.com/html/js/ js
ln -s /home/example/example.com/html/lib/ lib
ln -s /home/example/example.com/html/media/ media
ln -s /home/example/example.com/html/skin/ skin
ln -s /home/example/example.com/html/var/ var
我认为使用.htaccess重写也许是可能的,但我不知道如何设置它。
感谢您的帮助! :)
答案 0 :(得分:3)
看看@ Magento Multi store setup sub folders
使用.htaccess使用同一文件夹设置多个商店。
在magento中设置商店后,请更新.htaccess文件
SetEnvIf Host www\.store1\.com MAGE_RUN_CODE=base
SetEnvIf Host www\.store1\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^store1\.com MAGE_RUN_CODE=base
SetEnvIf Host ^store1\.com MAGE_RUN_TYPE=website
SetEnvIf Host www\.store2\.com MAGE_RUN_CODE=store2
SetEnvIf Host www\.store2\.com MAGE_RUN_TYPE=store
SetEnvIf Host ^store2\.com MAGE_RUN_CODE=store2
SetEnvIf Host ^store2\.com MAGE_RUN_TYPE=store
了解更多@