开发者

site URL for the facebook like button

I have a problem with the Facebook like button. I want the note on user's profile to look something like this: 'User likes page on site'.

Site's URL it suppose to be 'http://www.example.com/myapp/' and t开发者_如何学Pythonhe page URL it's 'http://www.example.com/myapp/page.html'.

I added <meta property="og:site_name" content="..."/> in the of any page and added the like button using <iframe>.

I know that there's a solution to specify the canonical URL, but for the page that user likes, not for the site (that is by using og:url on the header). Does anyone know how you can specify the site's URL? It somehow automatically points to the domain name, which it's wrong in my case because i need 'http://www.example.com/myapp/', not 'http://www.example.com'.

I want the following result: User likes 'http://www.example.com/myapp/page.html' on 'http://www.example.com/myapp', not User likes 'http://www.example.com/myapp/page.html' on 'http://www.example.com'.

Thank you very much for a possible answer.


We've been running into similar problems and in lieu of a og:site_url tag have had to get a little hacky. Our solution is to have our base URL (http://www.example.com in your example) redirect to the FB page.

As we add more FB pages, we'll need multiple subdomains to support this, so it's not really sustainable, but may solve your problem at least temporarily.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜