Does Facebook support Hash Bang #! Ajax Crawlable Urls?

前端 未结 1 1870
小鲜肉
小鲜肉 2021-02-14 04:45

Does Facebook support Google\'s ajax crawling specification and, if so, what do you need to do to implement it?

I am trying to get the Facebook \"Like\" button to work w

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 05:10

    This is also a big problem for me, but unfortunately it appears Facebook does not support this Google URL notation. Facebook's crawler/parser does not translate from hash bang (#!) to an _escaped_fragment_ format URL.

    Like you I have tested my page on Facebook's URL linter and it only picks up static Open Graph tags within the dynamic original page, rather than the page-specific Open Graph tags in the _escaped_fragment_ server-side variant of my page. Unfortunately, this means that Facebook sees my Open Graph tags as site-specific, rather than page specific.

    It is rather an irony that this appears to be unsupported as Facebook uses this approach itself to allow Google's crawlers to pick up Facebook pages.

    One potential workaround, that may help you a little bit, is:

    1) Use your _escaped_fragment_ page version in Facebook links 2) Add an automatic redirect to your _escaped_fragment_ variant to the proper version.

    This should mean that Facebook will pick up the proper meta tags, and the user will click the link and end up on the correct page. The downside of this approach is that the user has to know the rather ugly _escaped_fragment_ URL. In other words, it will probably only be you that knows it, unless you add some sort of 'generate shareable link' button to your page.

    It is surely only a matter of time before Facebook adds support for this as single-page hash bang sites are only going to become more prevalent.

    0 讨论(0)
提交回复
热议问题