Magento: Enable Secure URLs (HTTPS) for Frontend and Admin
Turn on HTTPS for the Magento storefront and admin: configure secure base URLs and switch on Magento secure URLs safely in minutes.
Magento secure urls
Magento secure urls : Enable secure url from backend for frontend and for admin
System -> Configuration -> GENERAL -> Web -> Secure -> Use Secure URLs in Frontend = Yes
System -> Configuration -> GENERAL -> Web -> Secure -> Use Secure URLs in Admin = Yes
Get secure url
<?php
Mage::getBaseUrl('url', $secure = true);
?>
Check if you are on secure url or not with magento code
<?php
if (Mage::app()->getStore()->isCurrentlySecure()) {
echo 'Current URL is Secure';
} else {
echo 'Current URL is NOT Secure';
}
?>
Still on Magento 1? This tutorial is for Magento 1.x, which reached end of life in June 2020 and no longer receives security patches. Our team migrates Magento 1 stores to Magento 2, Mage-OS or Adobe Commerce with your SEO and data intact — see our Magento development services.
Further reading: OpenMage, the community-maintained Magento 1 fork. Need a hand? Our Magento development team can help.
