Get base secure URL in Magento

  • magento get secure base url
  • magento get secure url
  • magento get base url
  • magento getbaseurl secure
  • base url in magento
  • magento secure base url

You must used getBaseUrl() in Magento many times and you may tried getBaseSecureUrl() and expect to get secure HTTPS URL but I guess you got empty and no error. So actually here is the right way to get different URL type in Magento with custom parameter

Get base secure URL

Mage::getUrl('',array('_secure'=>true)

-> Work when the secure URL is given in configuration only
Sometime you need to force secure URL

Mage::getUrl('',array('_forced_secure'=>true)

Check Magento wiki for getUrl function parameters  for more  custom parameters you can use

Comments

Leave a Reply

Your email address will not be published.

2 × 1 =

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>

Security Code: