没有符号链接的magento多重存储子文件夹 [英] magento multistore subfolder without symlinks
问题描述
是否可以在不创建符号链接的情况下使用子文件夹/子目录设置magento多层存储?
It's possible to setup a magento multistore with subfolders/subdirectories without need of create symlinks?
For example:
www.mainstore
www.mainstore/store1
www.mainstore/store2
www.mainstore/store3
某些托管服务提供商出于安全原因已禁用了符号链接,通常的方法是在magento根目录中为每个存储区创建一个文件夹,在其中复制index.php和.htaccess并建立到所有其他magento文件夹的符号链接,像这样:
Some hosting providers have disabled the symlinks for security reasons, and the normal method is making one folder for each store in the magento root foolder, copy in them index.php and .htaccess and make symlinks to all the other magento folders, like this:
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重写可能是可行的,但是我不知道该如何设置.
I think that maybe is possible with .htaccess rewritings, but I don't know how I can setup this.
感谢您的帮助! :)
推荐答案
To setup multi store using the same folder using .htaccess.
在magen中设置商店后,即可更新.htaccess文件
After setting up your stores in magento update your .htaccess file
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
阅读更多@
这篇关于没有符号链接的magento多重存储子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!