Facebook replaces URL #! V on "_escaped_fragment_" when shared

I am trying to share this url with my Facebook app: http://www.example.com/#!v;id=NH1NlYov3bKJ

However, it is automatically replaced with: http://www.example.com/?_escaped_fragment_=v%3Bid%3DNH1NlYov3bKJ

This url is not correct and it is not retrieving the correct title, description and images from the web page. What can I do? Thanks to

+3


source to share


4 answers


Why does your url contain a sequence #!

? Can you change it? Since the ajax content is not crawlable, consistency is part of the spec (Google) to make this content crawlable and most internet big fish are already using it.

How it works? Let's say you have a url like www.example.com/folder#!id=4

. This means some of the content of the url is delivered by ajax and it depends on the id = 4 information called the hash. Google crawler will try to read a page www.example.com/folder?_escaped_fragment_=id=4

instead, where according to the spec the crawler expects to find a single page ajax version.



I don't like it at all, but it works, which is why Twitter, Facebook, Groveshark and many other big fish use the spec. So when you share a grooveshark song on facebook (100% ajax page), facebook knows where to find the non-ajax version on the same page. But because of this, Facebook is also trying to change your URLs.

+8


source


Stop using #!

or process escaped snippet requests as recommended by Google.


See Google's "Complete Specification" for Webmasters :



Every URL that contains a hash fragment that starts with an exclamation mark is considered a #! URL . Please note that any URL can contain at most one hash fragment. Each pretty (#!) URL has a corresponding ugly (_escaped_fragment_) URL, which is output like this:

  • The hash fragment becomes part of the request parameters.
  • The hash fragment is specified in the request parameters, preceded by _escaped_fragment _ =
  • Some characters are escaped when the hash fragment becomes part of the request parameters. These symbols are listed below.
  • All other parts of the URL (host, port, path, existing query parameters, etc.) remain unchanged.

In this case, Facebook makes the move pretty-ugly (or client-dynamic to crawl). Remember that the form _escaped_fragment_

must contain a repeatable snapshot.

+6


source


Hakki, I know, but I'm going to use .htaccess and mod_rewrite to catch the _escaped_fragement_ urls. In my case, this is because I made a clean .html / .js web page with one page and I need to catch when the search engine needs a snapshot, but you can use the same method to overwrite the ugly _escaped_fragment_ in the right format for your website.

0


source


Another idea would be to push the correct url through the shortcut service before you share it like http://goo.gl/

-1


source







All Articles