We’re using a 3rd party image hosting service, which means when a customer goes to My Account -> My Product Reviews they get hit with a secure/insecure image message. While it’s possible just to change the protocol for the external image link to https, it got me thinking, how DO you determine whether the page in Magento is being served via http or https? I dug around the controllers and various xml files and didn’t see anything.
Well, I’m not quite sure what exactly you want to get, but to know if current page served via http or https in Magento
you can check it by $this->getUrl(’’); ($this->getAccountUrl()) or some similar function (in .phtml) and then compare it first
characters with http and https…
> How/where is it determined whether a page is served as secure or insecure?
in Mage_Core_Model_Url, search by text “[’_secure’]”.
To see examples, open Mage_Customer_Block_Account_Dashboard and look at any func, that generates a secure URL:
public function getAddressEditUrl($address) { return Mage::getUrl('customer/address/edit', array('_secure'=>true, 'id'=>$address->getId())); }