大网数据广告活动
网站运营与故障问答

Can I use sitemap.xml to redirect bots to seo specific urls

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。