Récemment


[1.5.0.17]+ Redirection vers http forcée suite à redirection shop domain (en https)



  • Lorsque l'internaute demande le shop par l'un des domaines non canonical (domain.tld vs www.domain.tld),
    PrestaShop provoque une redirection vers le http://www.domain.tld.
    Ceci conduit à une cascade de redirections. https://domain.tld => http://www.domain.tld => https://www.domain.tld

    Le code coupable se situe dans classes/shop/Shop.php,
    Fonction Shop::initialize(), 2 segments à corriger.

    En 1.6+
    Remplacer:

    header('Location: http://'.$url);
    

    par:
    header('Location: '.(Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE') ? 'https://' : 'http://').$url);

    header('Location: '.Tools::getShopProtocol().$url);
    

    1.5+ plus ou moins la même chose mais d'autres occurrences de header('location'...) sont à corriger. La variable $url contenant déjà le protocole.



  • header('Location: '. Tools::getShopProtocol() . $url);
    :smirk: