Magento – How to check if URL has http:// or https://

magento-1.9sslurl

In my Magento website I have configured SSL certificate in some pages only. So how to check if the current page has http:// or https://?

I am using Magento 1.9

Best Answer

You can use below as another solution:

if (Mage::app()->getStore()->isFrontUrlSecure() 
    && Mage::app()->getRequest()->isSecure()
) {
    // current page is https
}else {
    // current page is http
}
Related Topic