I am trying to add the Facebook Comment plugin to my site.
http://www.ourhometown.ca/hockey/nhl/NHL0017.php

When you visit the link in Firefox you get the above URL. If you hit refresh, you get something like:
http://www.ourhometown.ca/hockey/nhl/NHL0017.php#.UbAQAth230c

This lack of a static url will cause issues for the site. Does anyone know how to tweek the code so that the query string doesnt show and the url will always be - http://www.ourhometown.ca/hockey/nhl/NHL0017.php

Any help would be appreciated.

Member Avatar for LastMitch

Does anyone know how to tweek the code so that the query string doesnt show and the url will always be -

That hash # is more related to Javascript. I don't see much Daniweb members post URL rewrite in PHP that has #.

You can try this (PHP):

$url = preg_replace('/\#.*/', '', $url);

or this

str_replace( $_SERVER['QUERY_STRING'], '', $_SERVER['HTTP_REFERER'] )
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.