I have an SPA with a lot of images in it. I want to expose those images to search engines. So I want to create “special” pages that will only be seen by the bot. The pages will contain metadata about the images.
Is it possible to make googlebot crawl one page but index it as another?
2
Answers
Yes, it is possible to detect Google Bot via HTTP_USER_AGENT, but You will probably will get Google Ban and PR set to 0.
You can set a page which ONLY Google bot sees.
How it works:
You basically set up a server which serves like a client’s browser, and it “sits” between your “real server” which delivers the HTML and assets (JS/CSS/images) and the Crawler Bot. This server is called a pre-render server and it only sends data to bots, not to real clients, because it has its own URL that is mapped to use it. the URL would like like any of your pages’ URLs but with some special addition at the end (probably).
The pre-render server acts like a browser, so the Javascript is parsed, and only when the page is ready (you would need to carefully trigger a
ready
command somewhere in your code after all the ajax has been called and you the content has “settled down”, and only when that command is called, the pre-render server will serve the content forward to the bot, so the bot will see a “static page”, “fed to it with a spoon”.https://developers.google.com/webmasters/ajax-crawling/docs/learn-more#what-the-user-sees-what-the-crawler-sees
This technique isn’t so easy to set up, but it is possible.