FB OpenGraph og:image 不拉图像(可能是 https?) [英] FB OpenGraph og:image not pulling images (possibly https?)

查看:15
本文介绍了FB OpenGraph og:image 不拉图像(可能是 https?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook 无法抓取我的 og:image 文件,我已经尝试了所有常用的解决方案.我开始认为它可能与 https://...

Facebook cannot grasp my og:image files and I have tried every usual solution. I'm beginning to think it might have something to do with https://...

  • 我已经检查了 http://developers.facebook.com/tools/debug 和有零警告或错误.
  • 它正在查找我们在og:image"中链接的图像,但它们显示为空白.然而,当我们点击图像时,它们确实存在,而且它们是直接的.
  • 它确实显示了一张图片 - 托管在非 https 服务器上的图片.
  • 我们尝试过方形图像、jpeg、png、较大尺寸和较小尺寸.我们已将图像放在 public_html 中.零出现了.
  • 这不是缓存错误,因为当我们向元添加另一个 og:image 时,FB 的 linter 确实会找到并读取它.它确实显示了预览.预览是空白的.我们得到的唯一例外是针对不在本网站上的图片.
  • 我们认为 cpanel.htaccess 上的一些反浸出可能阻止图像显示,因此我们进行了检查.这没有.我们甚至做了一个快速的 <img src="[远程文件]";> 在完全不同的服务器上,图像显示正常.
  • 我们认为可能是 og:type 或另一个带有另一个元标记的奇怪之处.我们一次删除了所有这些并进行了检查.没变.只是警告.
  • 在不同网站上显示相同的代码没有任何问题.
  • 我们认为也许它没有提取图像,因为我们对多个产品使用相同的产品页面(根据获取值更改它,即details.php?id=xxx")但它仍然在拉入一张图片(来自不同的网址).
  • 关闭任何 og:image 或 image_src,FB 找不到任何图像.
  • I have checked http://developers.facebook.com/tools/debug and have zero warnings or errors.
  • It is finding the images we linked to in the "og:image", but they're showing up blank. When we click the image(s), however, they DO exist and it takes is straight to them.
  • It DOES show one image -- an image hosted on a non-https server.
  • We've tried square images, jpegs, pngs, larger sizes and smaller sizes. We've put the images right in public_html. Zero are showing up.
  • It's not a caching error, because when we add another og:image to the meta, FB's linter does find and read that. It DOES show a preview. The preview is blank. The only exception we're getting is for images that are not on this website.
  • We thought maybe there was some anti-leach on cpanel or the .htaccess that was preventing the images from showing up, so we checked. There was not. We even did a quick < img src="[remote file]" > on an entirely different server and the image shows up fine.
  • We thought maybe it was the og:type or another oddity with another meta tag. We removed all of them, one at a time and checked it. No change. Just warnings.
  • The same code on a different website shows up without any issue.
  • We thought maybe it was not pulling images because we're using the same product page(s) for multiple products (changing it based on the get value, ie, "details.php?id=xxx") but it's still pulling in one image (from a different url).
  • Leaving any og:image or image_src off, FB does not find any images.

我已经快用完了.如果我说我自己和其他人在这方面花了多少时间,你会感到震惊.问题是这是一家在线商店.我们绝对绝对不能没有图像.我们必须.我们有十个左右的其他网站...这是唯一一个有 og:image 问题的网站.它也是 https 上唯一的一个,所以我们认为这可能是问题所在.但我们在网络上找不到任何先例.

I am at the end of my rope. If I said how much time myself and others have spent on this, you'd be shocked. The issue is that this is an online store. We absolutely, positively cannot NOT have images. We have to. We have ten or so other sites... This is the only one with og:image problems. It's also the only one on https, so we thought maybe that was the problem. But we can't find any precedent anywhere on the web for that.

这些是元标签:

<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

In case you want it, here's a link to one of our product pages that we've been working on. [Link shortened to try to curb this getting into search results for our site]: http://rockn.ro/114

编辑----

使用看看 Facebook 看到了什么"抓取工具,我们能够看到以下内容:

Using the "see what facebook sees" scraper tool, we were able to see the following:

"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"
      }
   ],

我们测试了它为单个页面找到的所有链接.都是完全有效的图像.

We tested all links it found for a single page. All were perfectly valid images.

编辑 2 ----

我们尝试了一个测试,并向非安全网站添加了一个子域(实际上可以通过 Facebook 看到来自该网站的图像).子域是 http://img.[nonsecuresite].com.然后我们将所有图像放入主子域文件夹并引用它们.它不会将这些图像拉入 FB.但是,它仍然会提取在非安全主域上引用的任何图像.

We tried a test and added a subdomain to the NONSECURE website (from which images are actually visible through facebook). Subdomain was http://img.[nonsecuresite].com. We then put all images into the main subdomain folder and referenced those. It would not pull those images into FB. However, it would still pull any images that were referenced on the nonsecure main domain.

已发布的解决方法----

POSTED WORKAROUND ----

感谢 Keegan,我们现在知道这是 Facebook 中的一个错误.为了解决这个问题,我们在不同的非 HTTPS 网站中放置了一个子域,并将所有图像转储到其中.我们在每个产品页面上的 og:image 中引用了协调的 http://img.otherdomain.com/[like-image.jpg] 图像.然后我们必须通过 FB Linter 并运行每个链接来刷新 OG 数据.这行得通,但解决方案是创可贴解决方法,如果 https 问题得到解决,我们又回到使用自然 https 域,FB 将缓存来自不同网站的图像,使情况变得复杂事项.希望这些信息有助于让其他人免于失去生命中的 32 个编程小时.

Thanks to Keegan, we now know that this is a bug in Facebook. To workaround, we placed a subdomain in a different NON-HTTPS website and dumped all images in it. We referenced the coordinating http://img.otherdomain.com/[like-image.jpg] image in og:image on each product page. We then had to go through FB Linter and run EVERY link to refresh the OG data. This worked, but the solution is a band-aid workaround, and if the https issue is fixed and we go back to using the natural https domain, FB will have cached the images from a different website, complicating matters. Hopefully this information helps to save someone else from losing 32 coding hours of their life.

推荐答案

我遇到了同样的问题,并在 Facebook 开发者网站上将其报告为错误.很明显,og:image 使用 HTTP 的 URI 可以正常工作,而使用 HTTPS 的 URI 则不行.他们现在承认他们正在调查此事".

I ran into the same problem and reported it as a bug on the Facebook developer site. It seems pretty clear that og:image URIs using HTTP work just fine and URIs using HTTPS do not. They have now acknowledged that they are "looking into this."

更新:自 2020 年起,该错误在 Facebook 的票务系统中不再可见.他们从未回应,我认为这种行为没有改变.但是,在 og:image:secure 中指定 HTTPS URI 似乎工作正常.

Update: As of 2020, the bug is no longer visible in Facebook's ticket system. They never responded and I don't believe this behavior has changed. However, specifying HTTPS URI in og:image:secure does seem to be working fine.

这篇关于FB OpenGraph og:image 不拉图像(可能是 https?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆