dousa2794 2015-04-10 17:52
浏览 53
已采纳

打开Graph标签不能在WordPress / Codeigniter集成中工作

My website is wpci-dev.com. I have integrated a Codeigniter web application with WordPress. In the WordPress theme header, I have placed these meta tags:

<meta property="og:title" content="RealConnect Dev Site"/>
<meta property="og:url" content="http://wpci-dev.com"/>
<meta property="og:description" content="This is a development site for Birch Studio Graphic's RealConnect web application."/>
<meta property="og:image" content="http://wpci-dev.com/images/BSGlogoBLK.jpg"/>
<meta property="og:type" content="website"/>

If I use the Facebook Debugger with wpci-dev.com, the scraper picks up my meta tags and displays the content correctly when shared. I can also check wpci-dev.com/about-us/ with the debugger and get the correct results.

The problem is when I try to share a page that is rendered using Codeigniter - wpci-dev.com/details/residential/449153/, the open graph tags are not being scraped:

Object debugger response

If I click on the "See exactly what our scraper sees for your URL" link, It displays a white page with the text "Document returned no data":

Scraper response

We developed another site, MyCAAR.com, which is built completely in Codeigniter (no WordPress), and the open graph tags work correctly for all of the pages. So, I don't think this is a Codeigniter issue. I think it has something to do with the Codeigniter/WordPress integration.

I have searched far and wide for answers to this issue with no luck. Any help is appreciated.

  • 写回答

1条回答 默认 最新

  • douqian2524 2015-04-12 16:48
    关注

    http://wpci-dev.com/details/residential/449153/ returns an HTTP status code 404 Not Found, even when requested via a normal browser. Therefor, the Facebook scraper will consider this an error, and not take any OG meta data from the source, even if it should be in fact present.

    Your server explicitly tells every HTTP client that the requested content does not exist. The fact that common browsers still display the HTTP response body content in such cases doesn’t change that one bit (and they only do so, because it is supposed to contain an error message readable by humans.)

    So you’ll need to investigate why these page(s) are served with a 404 status code, and fix it to return a “normal” 200 OK. (Specifics will depend on how exactly your WP/CI integration works and what it does.)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化