Werring
Werring

Reputation: 362

SetEnv appends an = sign after the value

For a magento multi-store website im trying to link multiple domains to the same codebase but display different stores. According to the documentation you can do this by using SetEnv & SetEnvIf in a htaccess file.

SetEnv MAGE_RUN_CODE=defaultstore
SetEnvIf Host ^(www\.)?example1\.com MAGE_RUN_CODE=examplestore
SetEnvIf Host ^(www\.)?example2\.com MAGE_RUN_CODE=example2store
SetEnvIf Host ^(www\.)?example3\.com MAGE_RUN_CODE=example3store

Finally i found out that when i request the value of MAGE_RUN_CODE in php with $_SERVER['MAGE_RUN_CODE'] there is a '=' sign appended to the value (So 'defaultstore=', 'examplestore=', etc).

Currently my only solution is to modify the index.php of magento and rtrim($_SERVER['MAGENTO_RUN_CODE'],'=');.

I would prefer to keep the index.php unchanged. Is there a reason why my Env variables have an '=' appended to it?

I am running a Parallels Plesk Panel v11.5.30 on CentOS 6 Using Apache 2.2 and PHP 5.3

Upvotes: 1

Views: 166

Answers (1)

Dimag Kharab
Dimag Kharab

Reputation: 4519

No need to give assignment operator , it should be

SetEnv MAGE_RUN_CODE defaultstore

Upvotes: 3

Related Questions