View Full Version : url rewrite rule for fb comment

25 Jul 2012, 01:23 AM

I have a website and set a facebook comment box on some pages. The comment box itself is working fine but when a visitor comments on it and on his fb wall, the link to the website page of the posted comment leads to an error page. I guess it because of the comment box automatically adds parameters.

e.g. Comment box on a page http://www.example.com/example1/page1/ will changed into http://www.example.com/example/page1/?fb_comment_id=fefeq46346461536131 which is obviously not existed.
Some of the pages have .aspx at the end of url for some reason, then the fb comment link (http://www.example.com/example2/page2.aspx?fb_comment_id=fewfw46546846354) works fine.

I reckon what I can do is to set up url rewrite rule on IIS but following rule I made not working:
pattern> (.*)\?fb_comment_id
url> {R:1}
Can someone help me to solve this issue please?


25 Jul 2012, 06:06 PM
Thanks but it's sorted by importing url rule
RewriteCond %{QUERY_STRING} ^fb_comment_id= [NC]
RewriteRule (.*) $1? [NC,R=301,L]
I didn't know IIS has such a feature and works perfect.