4

Visitors to my website in HTTPS are receiving messages that some of the content is not secure. Upon investigation it appears that my active template has a getUrl and getSkinUrl code that calls the home button but displays it in HTTP and not HTTPS.

<a href="<?php echo $this->getUrl() ?>"><img src="<?php echo $this->getSkinUrl(); ?>images/Home.gif" alt="<?php echo $this->__('Home');?>"/>

How do I make a call to getUrl and getSkinUrl to generate secure links on secure pages?

0

2 Answers 2

10

first of all, this:

<?php echo $this->getSkinUrl(); ?>images/Home.gif

should be

<?php echo $this->getSkinUrl('images/Home.gif'); ?>

You can pass parameters to getUrl to make it secure:

$this->getUrl('', array('_secure'=>true));
$this->getSkinUrl('images/Home.gif', array('_secure'=>true));
2
  • The reason for the alt was so that in a text browser "Home" will appear, I'll modify my file and report back. Thanks for the quick response!
    – SR_Magento
    Commented Mar 1, 2014 at 15:25
  • 1
    Leave the alt where it is. just modify the urls
    – Marius
    Commented Mar 1, 2014 at 15:29
0

Change the unsecure URL under:

System > Configuration > General > Web > Unsecure

Needs to be changed to http:// instead of https://.

This fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.