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.












