具有大量动态子域的站点的站点地图 [英] Sitemap for a site with a large number of dynamic subdomains
问题描述
我正在运行一个允许用户创建子域的站点.我想通过站点地图将这些用户子域提交给搜索引擎.但是,根据站点地图协议(和 Google 网站管理员工具),单个站点地图只能包含来自单个主机的 URL.
I'm running a site which allows users to create subdomains. I'd like to submit these user subdomains to search engines via sitemaps. However, according to the sitemaps protocol (and Google Webmaster Tools), a single sitemap can include URLs from a single host only.
最好的方法是什么?
目前我有以下结构:
- 位于 example.com/sitemap-index.xml 的站点地图索引,其中列出了每个子域(但位于同一主机)的站点地图.
- 每个子域都有自己的站点地图,位于 example.com/sitemap-subdomain.xml(这样站点地图索引仅包含来自单个主机的 URL).
- 子域的站点地图仅包含来自子域的 URL,即 subdomain.example.com/*
- 每个子域都有 subdomain.example.com/robots.txt 文件:
--
User-agent: *
Allow: /
Sitemap: http://example.com/sitemap-subdomain.xml
--
我认为这种方法符合站点地图协议,但是,Google 网站管理员工具会为子域站点地图提供错误:不允许使用 URL.此位置的站点地图不允许使用此 URL."
I think this approach complies to the sitemaps protocol, however, Google Webmaster Tools give errors for subdomain sitemaps: "URL not allowed. This url is not allowed for a Sitemap at this location."
我还检查了其他网站是如何做到的.例如,Eventbrite 生成的站点地图包含来自多个子域的 URL(例如,请参阅 http://www.eventbrite.com/events01.xml.gz).但是,这不符合站点地图协议.
I've also checked how other sites do it. Eventbrite, for instance, produces sitemaps that contain URLs from multiple subdomains (e.g., see http://www.eventbrite.com/events01.xml.gz). This, however, does not comply with the sitemaps protocol.
对于站点地图,您推荐什么方法?
What approach do you recommend for sitemaps?
推荐答案
我最近一直在努力解决这个问题,并最终让它发挥作用.有关更多详细信息,请参阅此线程:
I recently struggled through this and finally got it working. See this thread for more details:
总结:
- 使用DNS 验证来验证您的网站和所有 一举成为子域
- 让所有子域上的 robots.txt 指向 www 域上的主站点地图
- 您可能需要等待几天,以便 Google 更新所有子域上的 robots.txt 缓存副本.在此之前它仍会显示错误.
- Use DNS verification to verify your site and all it's subdomains in one fell swoop
- make the robots.txt on all your subdomains point to the main sitemap on your www domain
- You may need to wait several days for Google to update it's cached copies of robot.txt on all your subdomains. It will still show errors until then.
这篇关于具有大量动态子域的站点的站点地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!