Setting up multiple websites or stores with Magento
There are many tutorials how Magento set to work with several branches in different domains and save at any point. Since the release of Magento and Magento beta1 CE 1.4.0.0 1.6.0.0 EE to do it just yet.
Magento evolves
Solutions used in earlier versions require developers to change index.php file to show different areas to be treated in different stores. New index php contains the following code:
$ MageRunCode = isset ($ _SERVER ['MAGE_RUN_CODE'])? $ _SERVER ['MAGE_RUN_CODE']:''; $ MageRunType = isset ($ _SERVER ['MAGE_RUN_TYPE'])? $ _SERVER ['MAGE_RUN_TYPE']: 'Save'; Mage:: run ($ mageRunCode, mageRunType $);
Shall examine two environmental projects variables and use them to start runing Magento. What does it mean to you? You can now save for the website / run directly under the selected domain in the virtual host definition, or even to htaccess.
VirtualHost solution
To enjoy this little piece of code is enough to add the following lines to your VirtualHost definition:
SetEnv MAGE_RUN_CODE base "" # this is your site or store code SetEnv MAGE_RUN_TYPE "Website" # you set this website "or" store "
.htaccess solution
If you do not have access to virtual host definitions, you can still try to use. Htaccess for this by the following lines:
SetEnvIf Host .* .* yourhost MAGE_RUN_CODE = "base"; SetEnvIf Host .* .* yourhost MAGE_RUN_TYPE = "Website"; Where yourhost .* .* is a regex expression matching the domain for which you want environment variable.
Recent Posts
GEO Vs AEO Vs SEO Comparison Guide – Revolution of AI Marketers in 2025
We’re entering a new era where AI and human curiosity come together and if your business isn’t ready, you could fall behi...
WordPress Plugin All-in-One WP Migration Security Bypass (2.0.4)
The All-in-One WP Migration plugin for WordPress has a security bypass vulnerability that could let attackers perform restric...
FAQ: All About the New Google “Hummingbird” Algorithm
Google has a new way of sorting information when searching for something. This system is called “Hummingbird.” Here's wha...
Meta new update to increase lead quality
Are you running Facebook Lead Ads but unhappy with the quality of leads you're getting? A key setting and a recent update cou...
