Get google to index links from javascript generated content

隐身守侯 提交于 2019-12-13 02:26:51

问题


On my site I have a directory of things which is generated through jquery ajax calls, which subsequently creates the html. To my knwoledge goole and other bots aren't aware of dom changes after the page load, and won't index the directory.

What I'd like to achieve, is to serve the search bots a dedicated page which only contains the links to the things.

Would adding a noscript tag to the directory page be a solution? (in the noscript section, I would link to a page which merely serves the links to the things.)

I've looked at both the robots.txt and the meta tag, but neither seem to do what I want.


回答1:


It looks like you stumbled on the answer to this yourself, but I'll post the answer to this question anyway for posterity:

Implement Google's AJAX crawling specification. If links to your page contain #! (a URL fragment starting with an exclamation point), Googlebot will send everything after the ! to the server in the special query string parameter _escaped_fragment_.

You then look for the _escaped_fragment_ parameter in your server code, and if present, return static HTML.

(I went into a little more detail in this answer.)



来源:https://stackoverflow.com/questions/4723689/get-google-to-index-links-from-javascript-generated-content

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!