2016 m. kovo 29 d., antradienis

seo dynamic url - hashbang

Google sees a link to example.com/#!/blog
Google requests example.com/?_escaped_fragment_=/blog

php:
if(isset($_GET['_escaped_fragment_'])) {
    Header( "HTTP/1.1 301 Moved Permanently" );
    header('Location: http://'.$_SERVER['HTTP_HOST'].$_GET['_escaped_fragment_']);
    die();
}

js:
history.pushState('page', null, '/#!/'+v.url+'/');

https://github.com/browserstate/history.js/ - pluginas kuris history state daro su hashbang arba be jo prilausomai ar html4 ar html5 narsykle

hadangi html5 palaiko pushstate, tai vengti hashbang.

FB mygtuku atveju nenaudoti hashbang, vistiek turime patiekti originalu normalu url.
Jeigu dinamiskai keitesei url, galima perkrauti FB skriptus:
FB.XFBML.parse(document.getElementById('myModal'));

Facebook scraper is respecting the google ajax specifications and it will convert the #! to ?_escaped_fragment_= You can check this out for yourself with the facebook debugger:https://developers.facebook.com/tools/debug

Update - google jau palaiko JS, todėl: Instead of the _escaped_fragment_ URLs, we'll generally crawl, render, and index the #! URLs.



2016 m. kovo 20 d., sekmadienis