When you create Facebook as buttons, Facebook uses cURL (trust me people) to access your metadata url. Thus , if cURL sees different metadata , for each URL, you will get different LIKE buttons.
But this does not happen; as on the server side, Facebook sees the same URL for each dynamic link #
. Since the part of the link before #
is the same. JavaScript (or any behavior that can create a hash in the URL) is ignored, obviously, since its behavior is only a client affair.
The best way would be to create the button dynamically using JavaScript and change the url for each button for something friendly without a hash.
abc.com/def
Only for curl script to see it as another url.
And when the user clicks on this link - abc.com/def/part1
- you need help on the server side to redirect part1
to the def
route to view. Thus, in your router code, you only load up to the def
route (imagine MVC), and then ask the controller to load the part1
, with JavaScript enabled, to add the hash of the URL #part1
.
source share