From 82cb9f8ba9a9e45fc6ab033b43c211adbd9d3c41 Mon Sep 17 00:00:00 2001 From: emily-d Date: Wed, 23 Jan 2013 22:30:18 +0100 Subject: [PATCH] [-] FO : PS_SSL_ENABLED and mod_rewrite yields a 301 error (Too Many Redirects) on pages served by https. See http://www.prestashop.com/forums/topic/217724-activer-le-ssl-url-simplifiee-mod-rewrite-ne-marche-pas-erreur-301-sur-les-pages-commandes for more info. --- classes/Tools.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index 8ec0b5ac0..b8c511c8a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -267,6 +267,9 @@ class ToolsCore // $_SERVER['SSL'] exists only in some specific configuration if (isset($_SERVER['SSL'])) return ($_SERVER['SSL'] == 1 || strtolower($_SERVER['SSL']) == 'on'); + // $_SERVER['REDIRECT_HTTPS'] exists only in some specific configuration (e.g. Gandi's simple hosting) + if (isset($_SERVER['REDIRECT_HTTPS'])) + return ($_SERVER['REDIRECT_HTTPS'] == 1 || strtolower($_SERVER['REDIRECT_HTTPS']) == 'on'); return false; }