Let me explain in brief. I have a FB Button on my product page, if anyone clicks the like button on it. My page comes under Activity tab on Facebook, so if anyone clicks my page link in facebook, it redirects back to my page however facebook adds query string as
www.abcd.com/shop/productx/&fb_action_ids=485653551476299&fb_action_types=og.likes&fb_ref=.UPeDRHNDS9c.like&fb_source=aggregation&fb_aggregation_id=246965925417366
But after this link reaches my site, the internal configuration changes all the & into / which is
www.abcd.com/shop/productx/fb_action_ids/4748009931767/fb_action_types/og.likes/fb_ref/.UPbzP0K2Q0g.like/fb_source/timeline_og/action_object_map/%7B%224748009931767%22:537586299592758%7D/action_type_map/%7B%224748009931767%22:%22og.likes%22%7D/action_ref_map/%7B%224748009931767%22:%22.UPbzP0K2Q0g.like%22%7D
So it is no more a query string and changes into proper url. This makes my site go into Infinite Loop.
Currently my htaccess conf is:
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA]
How to remove the extra URL added by the facebook?
Adding this above your current rules will remove everything starting from the &fb_action.
Note that I’m assuming this isn’t actually a query string, because in your question your URL looks like: