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

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

问题描述

首先 - 我不要认为这是一个重复的问题。我已经广泛地搜索了相同或类似的问题,由于问题的故障性质,我相信这个问题是独一无二的。

First -- I do not believe this is a duplicate issue. I've searched for same or similar problems on SO extensively, and due to the nature of troubleshooting before asking, I believe this problem is unique.

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://...

    $ b有关$ b
  • 我已经检查过 http://developers.facebook.com/tools/debug ,并发出零警告或

  • og:image 中找到我们链接的图像,但它们显示为空白。当我们点击图片时,它们确实存在,而且它们是直接的。

  • 它显示一个图像 - 托管在非https服务器上的图像。

  • 我们已经尝试过方形图像,jpegs,png,更大的尺寸和更小的尺寸。我们已将图像放在public_html中。零被显示。

  • 这不是一个缓存错误,因为当我们向元中添加另一个 og:image 时,FB的linter找到并阅读。它显示预览。预览空白。 只有异常是针对不在本网站上的图像。

  • 我们以为可能在 cpanel .htaccess 阻止图像显示,所以我们检查了。这没有。我们甚至做了一个快速的 img src =[remote file]> 在完全不同的服务器上,图像显示正常。

  • 我们认为也许是 og:type 或另一个元标记的奇怪。我们删除了所有这些,一次一个并检查它。不用找了。只是警告。

  • 不同网站上的相同代码没有任何问题。

  • 我们认为可能是因为我们使用相同的产品页面来产生多个产品,因为它不会拉动图像(根据获取值更改它,即details.php?id = xxx),但是它仍然在拉入一个图像(来自不同的URL)。

  • 保留任何 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 ----

我们尝试了一个测试并添加了一个子域到NONSECURE网站(通过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 ----

POSTED WORKAROUND ----

感谢基冈,我们现在知道这是Facebook的一个错误。为了解决这个问题,我们将一个子域放在不同的NON-HTTPS网站中,并将其中的所有图像转储。我们在 og:image http://img.otherdomain.com/ [like-image.jpg] c>在每个产品页面。然后我们必须通过FB Linter并运行EVERY链接来刷新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:使用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."

可以在这里看到错误:
https://developers.facebook.com/bugs/260628274003812

The bug can be seen here: https://developers.facebook.com/bugs/260628274003812

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

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