1
votes

I have a site that runs on 4 different sites during its lifecycle, e.g. my local machine, dev (where its merged with other developer changes), staging (client review) and live. Usually in projects I would put a switch in the configuration on the domain name so that the correct configuration values are used on the right domain. Magento uses the local.xml file, is it possible to configure the magento local.xml file to have different configuration values depending on the domain name?

Current XML Config

<default_setup>
     <connection>
       <host><![CDATA[myhost]]></host>
       <username><![CDATA[myuser]]></username>
       <password><![CDATA[mypassword]]></password>
       <dbname><![CDATA[mydatabase]]></dbname>
       <active>1</active>
     </connection>
</default_setup>
1

1 Answers

2
votes

The short answer is: There isn't. And here's why.

The Magento domain concept allows for different stores inside a single instance, but these instances are to be run unter the same URL. However, if these stores are using the same inventory, you can set them up as websites inside a single Magento instance. If you then select a website in the system configuration and select "Web", you can then choose the unencrypted and encrypted URLs that point to the store.

Using a different inventory, I would suggest running them in different instances. For backup purposes, for security purposes it's a good idea to gate separate stores in.