The Facebook Like Button Never Picks Up The Right Url

Well, the google +1 works fine, the tweet this button is cool, but really.....FHTML is rubbish. Basically facebook never picks up the current url through fhtml, unless I'm even more stupid than I think I am. Here's how to get facebook to take the right url for each page.

When you use the facebook like button you expect it to take the url of the page that your visitor is looking at. Well for the last 6 months that doesn't seem to happen and when people click on like they either find themselves liking facebook or they get an error.

So lets not trust fbhml and fill in the href field with the right url of the page.

Still take the xfbml option as this will allow people to comment...and such, but, don't trust facebook to fill in the url of the page for you!

If you are using wordpress or joomla or any other content management system where you can insert code into your pages, fill in the gap between <a href="<put the line below here>"

http://<?php echo($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);?>

This will use php to find the current url of your page and tell facebook which page people are looking at and make it work how it should! God bless twitter, + and all the other things that work how they should!