Facebook无法处理我的og:image
文件,我已经尝试了所有常规解决方法。我开始觉得这可能与https://...
有关。
- 我已检查http://developers.facebook.com/tools/debug,没有任何警告或错误。
- 它可以找到我们链接到的图像在“
og:image
”中,但是它们显示为空白。然而,当我们单击图像时,它们确实存在,而且能够直接访问它们。 - 它确实显示一个图像 - 一个托管在非HTTPS服务器上的图像。
- 我们已经尝试使用正方形图像、JPEG、PNG、不同大小的图像并将它们放在public_html目录下,但是没有一个显示出来。
- 这不是缓存错误,因为当我们添加另一个
og:image
到meta标记时,FB的lint工具会找到它并读取它。它确实显示预览,但预览为空白。唯一的例外是那些不在此网站上的图像。 - 我们认为可能是cpanel或.htaccess上的反盗链措施导致图像无法显示,所以我们进行了检查,但并没有发现问题。我们甚至在完全不同的服务器上进行了
< img src="[remote file]" >
测试,图像可以正常显示。 - 我们认为可能是
og:type
或其他meta标签的问题。我们逐一删除它们并进行检查,但没有任何变化,仅出现警告。 - 在其他网站上相同的代码可以正常显示。
- 我们想可能是因为我们对多个产品使用同一个产品页面(基于get值进行更改,例如“details.php?id=xxx”)而无法拉取图像,但仍然可以拉取一个图像(来自不同的URL)。
- 如果不加任何
og:image
或image_src标记,FB就无法找到任何图像。
我已经束手无策了。如果我说出我和其他人在此上花费的时间,你会感到震惊。问题是这是一个在线商店。我们绝对、肯定不能没有图像。我们必须有图像。我们还有大约十个其他网站......只有这个网站有og:image
问题。它也是唯一一个使用https
的网站,所以我们认为这可能是问题的原因。但我们在网络上找不到任何类似的先例。
这些是meta标记:
<meta property="og:title" content="[The product name]" />
<meta property="og:description" content="[the product description]" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-art-black.png" />
<meta property="og:image" content="http://www.[ADIFFERENTwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/ARShopHeader.png" />
<meta property="og:image" content="http://www.[ourwebsite].com/overdriven-blues-music-tshirt-art-black.JPG" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="https://www.[ourwebsite].com/apparel-details.php?i=10047" />
<meta property="og:site_name" content="[our site name]" />
<meta property="fb:admins" content="[FB-USER-ID-NUMBER]"/>
<meta name="title" content="[The product name]" />
<meta name="description" content="[The product description]" />
<link rel="image_src" href="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta name="keywords" content="[four typical keywords]">
<meta name="robots" content="noarchive">
如果您需要的话,这是我们正在开发的产品页面之一的链接。[由于缩短了链接以防止其进入我们站点的搜索结果,因此请点击]:http://rockn.ro/114
编辑——
使用“查看 Facebook 所看到的内容”抓取工具,我们能够看到以下内容:
"image": [
{
"url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-details-safari.png"
},
{
"url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-art-safari.png"
},
{
"url": "http://www.[theotherNONSECUREwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png"
}
],
我们测试了单个页面中找到的所有链接,所有链接都是有效的图像。
编辑2 ----
我们进行了一项测试,并向非安全网站添加了一个子域名(实际上通过Facebook可以查看其中的图像)。子域名为http://img.[nonsecuresite].com。然后,我们将所有图像放入主域名文件夹中并引用它们。它不会将这些图像拉入FB。但是,它仍然会拉入在非安全主域上引用的任何图像。
发布解决方法 ----
感谢Keegan,我们现在知道这是Facebook中的一个错误。为了解决问题,我们在另一个非HTTPS网站中放置了一个子域名,并且把所有图像都放在里面。我们在每个产品页面的og:image
中引用对应的http://img.otherdomain.com/[like-image.jpg]
图像。然后,我们必须遍历FB Linter并运行每个链接以刷新OG数据。这起作用了,但解决方案只是一个权宜之计,如果https
问题得到解决而我们回到使用自然 https 域名,则FB会从不同的网站缓存图像,使问题变得更加复杂。希望这些信息能够帮助其他人节省32个编码小时的生命。
og:type: og_products:product
更改为网站类型,看看是否可以获取图像。 - DMCS