Skip to content

Instantly share code, notes, and snippets.

@deivisonarthur
Last active December 17, 2015 14:09
Show Gist options
  • Save deivisonarthur/5622630 to your computer and use it in GitHub Desktop.
Save deivisonarthur/5622630 to your computer and use it in GitHub Desktop.
Redirect multilojas Magento com Nginx Adicionar no index.php do magento assim /* Store or website code */ $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; /* Run store or run website */ $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; Mage::run($mageRunCode, $mageRunType);
map $http_host $magesite {
ShopEmMagento.com default; #Se a url for www.ShopEmMagento.com joga para default
ShopEmMagento2.com store2; #Se a url for www.ShopEmMagento2.com joga para store2
}
server {
fastcgi_param MAGE_RUN_TYPE store;
fastcgi_param MAGE_RUN_CODE $magesite; #Aqui repassa para o Magento a loja
include fastcgi_params;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment