问题原文
原帖链接 · CZorio · CC BY-SA 3.0
Website is redirected to remove the www so www.example.com is redirecting to example.com.
Question is do I need to include the www in the sitemap for the robots.txt?
已采纳解答
原帖链接 · Mike -- No longer here · CC BY-SA 3.0
In your situation, Don't include "www" because web crawlers that do read the sitemap directive from your robots.txt will attempt to access the "www" version of your sitemap and then be redirected to the non-www version of the URL.
Not only will you be wasting a couple extra bytes by including "www", but the crawlers that parse the sitemap directive properly will be making two requests to your server: one for the www version, and one for the non-www version.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
