Take the 2-minute tour ×

I am using facebook comments and providing the url of the page to distinguish. here is the code I am using

<?php $commenturl="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>

  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  fjs.parentNode.insertBefore(js, fjs);

<fb:comments href="<?php echo $commenturl?>" num_posts="8" width="670"></fb:comments>

My url is www.domain.com/foldername/index.php?etc.

so it shows up the comment feed ok, but once someone posts a comment the url on his wall omits the foldername and directly goes to mangoestv.com/index.php?etc.

what am I supposed to do?

share|improve this question
add comment

1 Answer

I had the same problem was solution was to use htaccess to rewrite url , because it seems that facebook considers domain.com/index.php?var=abc and domain.com/index.php?var=xyz the same

so you should have url like that domain.com/abc and domain.com/xyz

Edit :

info about rewriting url's



share|improve this answer
i don't understand what you mean.... so i should have a redirect setup where domain.com is being forwarded to domain.com/foldername? –  Khu S Sep 28 '11 at 0:19
no no , its virtual you only need to edit ur .htaccess –  Tarek Sep 28 '11 at 3:28
ok i did this and seems to be working at my end now... thanks a lot for the suggestion –  Khu S Sep 30 '11 at 15:25
btw i did the rewrite like this [inline] RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.domain\.com$ RewriteRule ^/?$ "http\:\/\/www\.domain\.com\/foldername" [R=301,L] [/inline] the site does show up the right content but my facebook like counts are lost because the url add a ? after the foldername/ [inline] domain.com/foldername/?index.php&etc. [/inline] it should be domain.com/foldername/index.php&etc. anyway I can achieve that? –  Khu S Sep 30 '11 at 15:27
add comment

Your Answer


