SSL compatibility on load balanced servers
Magento doesn’t handle SSL certificates on load balanced servers very well.
Fix it with this.Â
.htaccess
... SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
And stick this in index.php, before the Mage::run line
foreach (array( Â Â 'SERVER_PORT' => 443, Â Â 'HTTP_X_FORWARDED_PROTO' => 'https', Â Â 'HTTP_CF_VISITOR' => '{"scheme":"https"}' ) as $key => $value) { Â Â if (isset($_SERVER[$key]) && $_SERVER[$key] == $value) { Â Â Â Â $_SERVER['HTTPS'] = 'on'; Â Â Â Â $_SERVER['SERVER_PORT'] = 443; Â Â Â Â break; Â Â } }
You may only need one or the other depending on your setup, but both also works fine.










