Friday 9 January 2015

Magento secure url Secure/Unsecure Link - Link Securely for Secure Pages only

hello

Your first (with the {{media}} tag) is correct and should work.

In the admin go to System > Configuration > Web > Secure and make sure the following are set:

    Base Link URL - {{secure_base_url}}
    Base Skin URL - {{secure_base_url}}skin/
    Base Media URL - {{secure_base_url}}media/

    Base Javascript URL - {{secure_base_url}}js/



This way all the paths generated will follow the protocol given in "Base URL". If a page is secure everything on it will also be served secure.

if you want secure url
 Mage::getUrl('',array('_secure'=>true));
Mage::getUrl('module/controller/action',array('_secure'=>true));

for example

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
// http://dominio.com/customer/account/loginPost

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));

// https://dominio.com/customer/account/loginPost




No comments:

Post a Comment

Thank You For Comment