Remove parts of Url using htacess

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

But after this link reaches my site, the internal configuration changes all the & into / which is

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]

Kindly help me on how to remove the extra URL added by the facebook


Adding this above your current rules will remove everything starting from the &fb_action.

RewriteRule ^(.*?)&fb_action /$1 [L,R=301]

Note that I'm assuming this isn't actually a query string, because in your question your URL looks like:
# no ? here----------------^

Need Your Help

gridlib cell format in python

python format wxpython

I am using a gridlib within wxpanel. I am creating the following grid:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.