Reputation: 315
i am implementing the facebook like button, and specified for it the url to like, when i click on the LIKE button, in facebook i saw the correct page the liked, but when i click on the link there the link is what is specified in the code with some odd facebook querystring appended.
for exmpl: the page that i like is http://www.mydomain.com/path/to/the/page
when i clicked on the liked link in facebook, the url is: http://www.mydomain.com/path/to/the/page?fb_action_ids=#####&fb_action_types=og.likes&fb_source=timeline_og&action_object_map={"###"%###}&action_type_map={"###"%3A"og.likes"}&action_ref_map=[]
and the page is not loaded correctly, is this is a facebook fault?
Upvotes: 3
Views: 1377
Reputation: 110
We can remove/strip the appended query string with the help of .htaccess file. Place the code mentioned below in your .htaccess file:
RewriteCond %{QUERY_STRING} fb_action_ids=.*$
RewriteRule .* %{REQUEST_URI}? [R=301,L]
RewriteCond %{QUERY_STRING} fb_comment_id=.*$
RewriteRule .* %{REQUEST_URI}? [R=301,L]
This will do the trick :)
Upvotes: 0
Reputation: 3230
I solved this problem by defining the URL in the fb:like button as well as in the og:url.
<fb:like href="http://www.yourwebsite.com/yourfullurl.html" send="true" layout="button_count" width="300" show_faces="false"></fb:like>
Now regardless of the parameters sent back from FB it seems to honor the count.
Upvotes: 0
Reputation: 204
Use the xfbml or html5 version of social plugin and include in your metatag this
<meta property="og:url" content="...." />
Upvotes: 1
Reputation: 15457
Facebook adds various parameters to the URL so you can track where the visits are coming from etc. Its probably your page that doesn't work with these parameters, rather than facebook. Ideally, you page should just ignore these parameters if you don't need them.
Upvotes: 0