使用 http:// 引用在 Magento 浏览器中验证 SSL 密封

发布于 2024-12-29 09:06:34 字数 1259 浏览 1 评论 0原文

因此,我的一位开发人员使用这样的函数为 Magento 电子商务网站制作自定义导航:

<li><a class="about" href="<?php echo $this->getUrl() ?>"><?php echo $this->__('about') ?></a></li>

唯一的问题是它的输出如下:

<li><a href="http://www.domain.com/about/" rel="nofollow">about</a></li>

据我了解,如果同时存在 http:// 和https:// 参考文献。

我正在尝试寻找一种快速解决方案来解决这个问题,如果有人有比现有方法更好的方法来解决这个问题,我会很高兴。

干杯!


修改后:

谢谢大家,

我想我已经将范围缩小到一个已安装的名为 Jirafe 的扩展。

输出代码是:

<noscript><p><img src="http://data.jirafe.com//piwik.php?idsite=#####" style="border:0" alt="" /></p></noscript>

我认为生成脚本的 php 文件是:

class Fooman_Jirafe_Model_JirafeTracker extends Piwik_PiwikTracker
{
    protected function sendRequest($url)
    {
        $client = new Zend_Http_Client($url);
        $response = $client->request();

        //check server response
        if ($client->getLastResponse()->isError()) {
            throw new Exception($response->getStatus() .' '. $response->getMessage());
        }
        return $response;
    }
}

如何通过 SSL 请求图像?

提前致谢!

So, one of my developers used a function like this to make a custom navigation for a Magento eCommerce site:

<li><a class="about" href="<?php echo $this->getUrl() ?>"><?php echo $this->__('about') ?></a></li>

The only problem is it's outputting like:

<li><a href="http://www.domain.com/about/" rel="nofollow">about</a></li>

From what I understand, SSL seals break in the browser if there are both http:// and https:// references.

I'm trying to look for a quick fix to remedy this and would be thrilled if someone has a better way to do this than what's been done.

Cheers!


Revised:

Thanks guys,

I think I've narrowed it down to an extenstion that was installed called, Jirafe.

The output code is:

<noscript><p><img src="http://data.jirafe.com//piwik.php?idsite=#####" style="border:0" alt="" /></p></noscript>

The php file that I think generates the script is:

class Fooman_Jirafe_Model_JirafeTracker extends Piwik_PiwikTracker
{
    protected function sendRequest($url)
    {
        $client = new Zend_Http_Client($url);
        $response = $client->request();

        //check server response
        if ($client->getLastResponse()->isError()) {
            throw new Exception($response->getStatus() .' '. $response->getMessage());
        }
        return $response;
    }
}

How would I request the image via SSL?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

路还长,别太狂 2025-01-05 09:06:34

您可以使用

$this->getUrl('', array('_secure' => true));

$this->getUrl('', array('_forced_secure' => true));

使 Magento 使用配置的 web/secure/base_url

You can use

$this->getUrl('', array('_secure' => true));

or

$this->getUrl('', array('_forced_secure' => true));

to make Magento use the configured web/secure/base_url.

2025-01-05 09:06:34

我认为在安全网页上使用非 ssl 链接不会有问题,毕竟您可能希望链接到另一个不支持 ssl 流量的网站。我想您可能会将此与在页面上包含非安全资源混淆。因此,在您的示例中,我不认为锚链接是一个问题,但如果它是带有 src 属性的 img 标签,那么它会导致问题,因为您告诉浏览器在安全页面上请求不安全的链接。

I don't believe there is a problem with having non-ssl links on a secure web-page, after all you might wish to link to another website that doesn't support ssl traffic. I think perhaps you can confusing this with including non-secure resources on a page. So in your example I don't believe the anchor link is a problem, but if it was an img tag with a src attribute, then it would cause issues, since you are telling the browser to request an insecure link on a secure page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文