Showing posts with label facebook. Show all posts
Showing posts with label facebook. Show all posts

Thursday, September 9, 2010

The Facebook Like button PITA: fb_xd_fragment=

So I have been using Facebook's like button for awhile now. I have it on a couple blogs, and a site I maintain using drupal. I started noticing that I was getting requests with a query of "?fb_xd_fragment=". This is a problem, because it shows a blank page.

I did some investigating, and this seems to be caused by two bugs (that I can tell). One, that Facebook's API causes a bug in IE that sends this query in the first place, and second that my website, because of the Facebook API, causes the page to become visibly blank because of it.

So, what to do? I decided to kill the query string at the source: my apache web server using mod_rewrite.

So here's what I added to the apache config for just this web server:

RewriteEngine On
RewriteCond %{QUERY_STRING} fb_xd_fragment=
RewriteRule (.*) $1? [R=301]

So this basically sends a 301 HTTP code (Moved Permanently) with the same request, minus the query string. Note that the "?" on the RewriteRule is needed so that mod_rewrite doesn't append the old query back on. Seems to be doing the trick, and now I'm not losing traffic due to a Facebook API bug.

Sunday, October 25, 2009

First Facebook App...

So I spent the majority of yesterday up until about 5am this morning, and most of today, finishing up my first booct application.

It's a cheesy music type application. I got the idea when this song was stuck in my head for 3 days straight. Basically a social way of telling friends/visitors what song is stuck in your head. It has the added bonus of being able to purchase the music and uses Amazon's Web Services. I get paid a percentage of purchases through the affiliate program.

If you want to check it out, go see Head Music on facebook.