问题原文
原帖链接 · Dogoku · CC BY-SA 3.0
I apologize for the title, but I can't really explain it . Here's what I am asking
Can I have seo specific urls in my sitemap.xml that will have canonical links to the actual urls.
E.g: Sitemap xml has a url of /foo/bar?seo=true and the content has a canonical link to /foo/bar
The reason we are considering this option:
We have a javascript SPA, that needs to be pre-rendered for bots. In order to avoid the overhead of checking on every request, we thought we can use sitemap.xml to redirect bots to a specific seo url, which will go through a pre-redenderer (e.g: phantomjs) and return the actual content, which includes a canonical link to the actual url.
已采纳解答
原帖链接 · David · CC BY-SA 3.0
You could, but you won't get the guarantee that it won't break users experience, leading a user to reach your website with ?seo=true appended to his request.
To make an example, Google specify that
We attempt to respect this, but cannot guarantee this in all cases.
meaning you should then check that they're actual users rather than bots. To be fair, IMHO, I won't expect that to happen that often, thus could effectively reduce the overhead due to a reduced number of requests to require special handling.
Furthermore you're not sure that a bot reaches your website via a link (which may be external to your website) rather than using the sitemap, and in that case you'll not serve the pre-rendered page. Although you have a sitemap the crawler algorithm may decide to crawl the page immediately without looking at the sitemap (at least at that moment).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
