duanchuang1935 2014-11-17 11:27
浏览 127
已采纳

Facebook分享者应该从获取的URL中提取图像而不是从规范URL中提取图像?

Recently i have noticed that if someone shares my website URL in facebook sharer then it pulls images from canonical URL not from fetched URL that is happening because of i have added -

<meta property="og:url" content="http://www.mywebsite.com"/>
<meta property="og:description" content="description related to page/images">

but it is showing every time my home page's images not of fetched URL

my URL are looking like that-

canonical URL - http://www.mywebsite.com
fetched URL - http://www.mywebsite.com/tags/car

So i'm not getting any idea what do i do so facebook sharer always show my fetched URL's images.

I know this could be same question asked before like these-

Is it possible to extract metadata from fetched url instead of canonical url?

Canonical url being linked on Facebook rather than real URL. Dynamic OpenGraph tags coming up empty

but there is a same solution in both question that is -

I need to setup Intermediate URL redirection, so i just searched about the 301, and 302 redirection, but i'm not getting any idea how/where do i use it?

I need to do this for my wordpress and an other website(which is in zend framework).

Please tell me anything if anyone has did the same.

I will be grateful for Any help.

  • 写回答

2条回答 默认 最新

  • doujiao1905 2014-11-26 12:28
    关注

    The problem you are facing is, that you are sending your home url as a canonical url of the shared url. This is wrong as a canonical url has to point to a resource with the same content as the fetched url. For a definition of what canonical urls are check RFC6596 or a good description from Google.

    Pointing to the Index URL of you site, as you do, is not pointing to a canonical (equivalent) URL. By setting that URL you are saying to Facebook "You can go look there, you will find the same content as here. So just take everything from there." But I guess this is not what you intend.

    If you still want to point to you index (which imho is abusing the system), then you can try also adding the metadata for an image, which should result in the image you provide to be used to represent the link:

    <meta property="og:image" content="http://www.mywebsite.com/path/to/image.jpg" />
    

    The reason, why you shouldn't point to your index as canonical: If a user A wants to share some specific content, user B clicking on the link in facebook won't find the expected content, instead he'll see the index page and doesn't know which content user A wanted to share.

    The correct way to use the og:url meta, is to point to a real canonical (equivalent) URL which will show the smae content as the fetched URL. Often such a link is referred to as permalink. If you can't provide such an url just use the fetched url itself or leave it away. Pointing to the index is wrong.

    For wordpress there is a plugin, which should do this correctly. And the open graph protocol is documented here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助