3
votes

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

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

I think that maybe is possible with .htaccess rewritings, but I don't know how I can setup this.

thanks for your help! :)

1

1 Answers

4
votes

Take a look @ Magento Multi store setup sub folders

To setup multi store using the same folder using .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

Read more @