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


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
  • i have added SSL in my site & i want to redirect selected page on http url instead of https. so how can i do that ? – Sarfaraj Sipai Apr 27 '18 at 5:19

You can use

$isSecure = Mage::app()->getStore()->isCurrentlySecure(); 


$isSecure = Mage::app()->getFrontController()->getRequest()->isSecure(); 

Source here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.