Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook like count resets after a 301 redirection

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

like image 561
Maor Barazany Avatar asked Oct 10 '22 19:10

Maor Barazany


1 Answers

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.

like image 88
bkaid Avatar answered Oct 13 '22 10:10

bkaid