You are here

Using .htaccess to fix the Facebook like IE fb_xd_fragment bug

If you notice any hits to URLs on your website with a querystring variable that look like:

http://mywebsite.com/somepage?fb_xd_fragment

Then chances are you have the Facebook like button installed and you are experiencing the notorious fb_xd_fragment bug caused by Internet Explorer. There are lots of solutions but if you use a *nix host and have access to your .htaccess file, the easiest thing to do is strip querystring variables matching fb_xd fragment.

Add the following lines and it should fix the problem. (Make sure you replace example.com with your actual URL.):


# Fix facebook bug
RewriteCond %{QUERY_STRING} ^fb_xd_fragment
RewriteRule ^(.*)$ http://example.com/$1? [R=301,L]

Make sure you test on your website before just assuming this works!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.