【问题标题】:Why are disqus comments not loading over https?为什么 disqus 评论没有通过 https 加载?
【发布时间】:2016-08-04 23:26:02
【问题描述】:

disqus cmets 正在这里加载:http://www.oddprints.com/help 但不在这里:https://www.oddprints.com/help 有什么想法吗?

所有资源似乎都是安全的(协议相关 url),所以我不认为是这样。

【问题讨论】:

标签: javascript https disqus


【解决方案1】:

这是因为 disqus 将两个 url 视为不同的,因此加载了不同的线程。如果您希望 http 和 https url 在其上具有相同的 cmets 线程,则需要在 disqus 配置中提供规范的 url。我就是这样做的:

<div id="disqus_thread"></div>
<script>
    /**
     *  https://disqus.com/admin/universalcode/#configuration-variables
     */
    var disqus_config = function () {
        this.page.url = "http://www.oddprints.com/help";
        //this.page.identifier = "oddprints"; // add a different id here if you want a fresh thread....
    };
    (function() {
        var d = document, s = d.createElement('script');
        s.src = '//oddprints.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

请注意,在配置中,我将 http url 作为规范 url 传递,并且我没有设置 page.identifier。我已经这样做了,以便它继续为我在 http 时已经拥有的 cmets 提供服务,并使用旧版本的 disqus sn-p。

【讨论】:

    【解决方案2】:

    Disqus 评论已加载,但 Disqus 认为这两个页面不同。

    你关注了吗:https://help.disqus.com/customer/portal/articles/542119-can-disqus-be-loaded-via-https-

    【讨论】:

    • 是的,我按照那个帮助页面做了。
    • 有没有办法让 disqus 认为这两个页面是相同的?还是迁移 cmets?
    • 感谢您的提示,它让我朝着正确的方向思考。我现在已经弄清楚了(请参阅我的其他答案)。干杯,马特
    • 不客气。由于我的回答很有帮助,也许您可​​以投票?
    猜你喜欢
    • 1970-01-01
    • 2012-06-23
    • 1970-01-01
    • 2023-04-07
    • 2012-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-16
    相关资源
    最近更新 更多