Facebook like count resets after a 301 redirection

蓝咒 提交于 2020-01-13 02:43:40

问题


I have an article on my site that has published in a wrong category. I wanted to change the category, and since the category name is part of the url, I than added a 301 redirection to the updated url. That article had also several likes, but after the 301, it was reset to 0 likes, since to Facebook this is now as a new url with no likes. If I remove the 301 than the likes count is updated again. Is there a way to notify FB that a certain url is a result of a 301 that has likes count? I assume it is relevant as well for pages with FB comments


回答1:


You would need to set the "href" or "data-href" property of the like button to the original url that had the like counts, depending on which like button you are using. Facebook will not follow redirects.



来源:https://stackoverflow.com/questions/7691311/facebook-like-count-resets-after-a-301-redirection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!