airbag Posted July 26, 2011 Share Posted July 26, 2011 Hello, I was having page issues with non-https items, and noticed that my page posts to /statistics.php using a non https url. The code in the statsdata module file is this. $.post("'._PS_BASE_URL_.__PS_BASE_URI__.'statistics.php", navinfo); How can I change this so it uses https if the page is an https one? If I do this, will the stats still be captured correctly? Link to comment Share on other sites More sharing options...
shokinro Posted July 26, 2011 Share Posted July 26, 2011 I don't remember exactly, I can not access my server to confirm, but I think there should be some definition for SSL. something like "_PS_BASE_URL_SSL_", you look into the /config/defines.inc.php to see if there is one you can use. Link to comment Share on other sites More sharing options...
airbag Posted July 26, 2011 Author Share Posted July 26, 2011 I don't remember exactly, I can not access my server to confirm, but I tihnk there should be some definition for SSL. something like "_PS_BASE_URL_SSL_", you look into the /config/define.inc.php to see if there is one you can use. Thanks Kinro! Link to comment Share on other sites More sharing options...
shokinro Posted July 26, 2011 Share Posted July 26, 2011 actually, _PS_BASE_URL_SSL_ is not defined in file /config/defines.inc.php but it was dynamically defined in following code of FrontController if (!defined('_PS_BASE_URL_SSL_')) define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); so it is correct to use _PS_BASE_URL_SSL_ Link to comment Share on other sites More sharing options...
airbag Posted July 27, 2011 Author Share Posted July 27, 2011 actually, _PS_BASE_URL_SSL_ is not defined in file /config/defines.inc.php but it was dynamically defined in following code of FrontController if (!defined('_PS_BASE_URL_SSL_')) define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); so it is correct to use _PS_BASE_URL_SSL_ Hi Kinro, What is my page is not a SSL one, will this force the file to be loaded into the browser using HTTPS, or will it recognise if it is HTTP or HTTPS and deliver the correct file? Link to comment Share on other sites More sharing options...
shokinro Posted July 27, 2011 Share Posted July 27, 2011 you can try to use following logic if( $_SERVER['HTTPS'] == "on" ) .. use SSL code else .. use none SSL code Link to comment Share on other sites More sharing options...
Recommended Posts