Right way to check secured HTTPS mode being used in Magento code

When you work with Ajax, this problem become important and you need to get it right way. Otherwise your Ajax request wont work on secure mode. So here here is how you will solve this problem in your custom code in correct Magento programming practice

if (Mage::app()->getStore()->isCurrentlySecure()) { //secure mode your current URL is HTTPS

} else { //your page is in HTTP mode


This tip will be helpful when you have to deal with displaying images,….too.

Leave a Reply

Your email address will not be published.

4 × one =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>