⬆️ ⬇️

Ajax site indexed by all search engines

I see a lot of articles on what people are trying to make Ajax sites, but they are confused by the fact that such sites will not be indexed by search engines. Google has it all right, you can use a special syntax .



Some time ago I had a task to make an Ajax site working “like Twitter”, but at the same time being indexed by search engines.





')

There was no problem with Google, but it was more complicated with Yandex. Everything was solved quite simply. We must do so that the site would work without Javascript. As for users with disabled Javascript. And converted the links on the site to the desired format when you visit the site through a browser with Javascript enabled.



As a result, it was decided to make the site static with static / p / video links and convert them to “broken web” when loading the site.



  1. $ ( "a" ) . each ( function ( ) {
  2. var href = $ ( this ) . attr ( "href" ) ;
  3. if ( href ) {
  4. var nh = href. replace ( / ^ / p // g, "/ #! /");
  5. $ ( this ) . attr ( "href" , nh ) ;
  6. $ ( this ) . bind ( "click" , function ( ) {
  7. show ( $ ( this ) . attr ( "href" ) ) ;
  8. } ) ;
  9. }
  10. } ) ;




After that, the site user already clicks on the links of the form / #! / Video, which are tracked using jQuery Address Plugin v1.4 and loaded on the fly.



Site http://flir-russia.ru/

Indexed to Yandex

Indexed by Google

Source: https://habr.com/ru/post/140826/



All Articles