Facebook没有获得元标记,也无法废弃网址

时间:2014-08-27 12:53:43

标签: codeigniter facebook-graph-api addthis

我正在使用addthis在社交网站上分享。我想在FB上分享标题,描述等。它正在工作,但没有得到我的标题和描述。

我正在使用Open Graph Debugger工具,它说

  

“网站”类型的网址“XXXXX”上的对象无效,因为未提供“string”类型的必需属性“og:title”。

点击Scraped URL See exactly what our scraper sees for your URL 它没有显示。 那有什么问题?

代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta property="og:title" content="APPOITMENT" />
<meta property="og:type" content="article" />
 <meta property="og:url" content="http://xxxxxxxx/client/appointment/index" />
 <meta property="og:site_name" content="CBD"/>
  <meta property="og:description" content="Workday, a provider of cloud-" />

我做了一些调试。我使用codeigniter框架,并使用.htaccess文件进行重定向。当我在核心php文件中使用相同的代码时,它正在工作。但是在codeigniter中,它无法正常工作。

.htaccss:

 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule .* index.php/$0 [PT,L]

EDIT:

似乎CI使用像控制器/功能/一样的URL。所以我认为这是FB无法躲页的原因。所以我需要创建包含元标记的单个php文件吗?

1 个答案:

答案 0 :(得分:1)

尝试调试根URL。 https://developers.facebook.com/tools/debug/

这也将迫使Facebook更新您的元数据。