Facebook对象调试器:属性'og:url'无法解析为类型'url'

JMa*_*Man 19 facebook-opengraph

当我通过对象调试器运行我的Facebook Open Graph对象(http://www.21dads.com/testobject)时,我收到以下错误:

对象无效值:'thetestasdf:recipie'类型的URL'http://www.21dads.com/testobject'上的对象无效,因为属性'og:url'的给定值'www.21dads.com/testobject'可以不被解析为类型'url'.

缺少必需属性:og:url属性是必需的,但不存在.

缺少必需属性:og:type属性是必需的,但不存在.

缺少必需属性:og:title属性是必需的,但不存在.

这是对象页面上的HTML:

<html xmlns="http://www.w3.org/1999/xhtml">

    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# thetestasdf: http://ogp.me/ns/fb/thetestasdf#">
      <meta property="fb:app_id"      content="325291980834949" />
      <meta property="og:type"        content="thetestasdf:recipie" />
      <meta property="og:url"         content="www.21dads.com/testobject" />
      <meta property="og:title"       content="Cookie Recipie!" />
      <meta property="og:description" content="Tastiest recipe ever" />
      <meta property="og:image"       content="http://cdn.techpatio.com/wp-content/uploads/2009/11/cookie_law_eu.gif" />
      <title> Cookie Recipie</title>
    <head/>

    <body>
        <p> Test object page </p>
    </body>

</html>
Run Code Online (Sandbox Code Playgroud)

URL"www.21dads.com/testobject"是我的控制器,然后从视图文件生成HTML.为什么不能解析此URL?

为什么我已经包含其他"缺少必需属性"错误?

谢谢.

Jui*_*ter 29

你应该在og:url内容前面有方案(比如http://https://),或者这不是URL.

在特定情况下,你应该更换www.21dads.com/testobject使用http://www.21dads.com/testobject

  • @ jose920405应该可以通过linter访问URL (6认同)