0

I have added some links in a Magento static block, example:

    <a title="Click here for more information" href="{{store_url=about-us}" target="_self">About Us</a>

This seems to be working just fine, however once I am on HTTPS the links remain in a http:// format. Is there a way to have these automatically change to HTTPS as well?

Some advice would be greatly appreaciated.

TheDave
  • 81
  • 5
  • 11
  • Similar question in: http://stackoverflow.com/questions/584251/short-way-to-link-to-http-from-https-and-vice-versa-using-relative-links – PiLHA Oct 04 '12 at 03:28

1 Answers1

0

By default this is how Magento behave.

Try creating a links.phtml file with the following code

if(Mage::app()->getStore()->isCurrentlySecure()){
    $url = Mage::getUrl('about-us', array('_secure'=>true));
     //$url = Mage::getUrl('',array('_secure'=>true) . 'about-us'; // if above code doesn't work try this
}
else{
     $url = Mage::getUrl('about-us');
}

echo '<a title="Click here for more information" href="'. $url .'" target="_self">About Us</a>';

Then in your static block

{{block type="core/template" template="path/to/file/links.phtml"}}

Using apache rewrite will redirect the page to https but the link when viewing source will still be without https

If you have caching enable on your server double check to make sure it doesn't cache one version .... if cached, then you need to change block type (core/template) to one that doesn't cache)

MagePal Extensions
  • 17,646
  • 2
  • 47
  • 62