2017-02-09 100 views
0

我在我的https網站上收到間歇性混合內容錯誤。該網站的鏈接是stakeholdermap.com如何阻止Adsense在https網站上加載混合內容?

我已經檢查Chrome瀏覽器開發工具>網絡選項卡,我看到下面不安全網址的例子:

Mixed Content: The page at 'https://www.stakeholdermap.com/stakeholder-analysis.html' was loaded over HTTPS, but requested an insecure plugin data 'http://static.vertamedia.com/static/vpaid-ssp-vast.swf?aid=41476&sid=0&cb=146233.42079096.743365'. This content should also be served over HTTPS. ads?client=ca-pub-3370240294319443&format=300x250&output=html&h=250&slotname=8722343817&adk=5159607… 

Mixed Content: The page at 'https://www.stakeholdermap.com/stakeholder-analysis.html' was loaded over HTTPS, but requested an insecure plugin data 'http://ads2.vertamedia.com/vast/vpaid-config/?width=300&height=250&aid=4147…takeholdermap.com&v=2.2.90&t=flash&video_duration=&cb=73026784276589750000'. This content should also be served over HTTPS. 

但廣告位使用的是最新的代碼(//pagead2.googlesyndication.com/ pagead/js/adsbygoogle.js)

我很確定這些是由Adsense加載的。我的問題是如何阻止或強制它使用https?

回答

1

向用戶的瀏覽器來獲取安全內容,如果可能的話: <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> 如果廣告是通過HTTPS使用,那麼它會獲取該版本,否則,內容將被屏蔽,並在其另一處所示。把meta放在你網頁上的<head>部分,其中包含你所有的其他meta標籤。

您可以在這裏找到更多的信息:https://developers.google.com/web/fundamentals/security/prevent-mixed-content/fixing-mixed-content

+0

這似乎工作!謝謝! – projectmonkey