具有大量动态子域的站点的站点地图
我正在运行一个允许用户创建子域的网站。我想通过站点地图将这些用户子域提交给搜索引擎。但是,根据站点地图协议(和 Google 网站管理员工具),单个站点地图只能包含来自单个主机的 URL。
最好的方法是什么?
目前我有以下结构:
- 站点地图索引位于 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。”
我还检查了其他网站是如何做到的。例如,Eventbrite 生成包含来自多个子域的 URL 的站点地图(例如,请参阅 http://www.eventbrite.com/events01.xml.gz)。 eventbrite.com/events01.xml.gz)。然而,这不符合站点地图协议。
对于站点地图,您推荐什么方法?
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.
What is the best approach?
At the moment I've the following structure:
- Sitemap index located at example.com/sitemap-index.xml that lists sitemaps for each subdomain (but located at the same host).
- Each subdomain has its own sitemap located at example.com/sitemap-subdomain.xml (this way the sitemap index includes URLs from a single host only).
- A sitemap for a subdomain contains URLs from the subdomain only, i.e., subdomain.example.com/*
- Each subdomain has subdomain.example.com/robots.txt file:
--
User-agent: *
Allow: /
Sitemap: http://example.com/sitemap-subdomain.xml
--
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."
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我最近为此苦苦挣扎,终于成功了。有关详细信息,请参阅此帖子:
http://www .google.com/support/forum/p/Webmasters/thread?tid=53c3e4b3ab8d9503&hl=en&fid=53c3e4b3ab8d9503000497bd04ba63cf
摘要:
I recently struggled through this and finally got it working. See this thread for more details:
http://www.google.com/support/forum/p/Webmasters/thread?tid=53c3e4b3ab8d9503&hl=en&fid=53c3e4b3ab8d9503000497bd04ba63cf
Summary:
是的,子域名限制位于 sitemaps.org 规范中,但是 Google 已实施了一些例外情况:
验证您的 Google 网站站长工具帐户中的所有子域名
http://www.google.com/support/webmasters/bin /answer.py?answer=75712
通过 Google 网站管理员工具交叉提交站点地图 XML - 如果通过您的域的根提交 - 不会引发 Google 错误
在子域的 robots.txt 中,您可以指向其他域上的站点地图 XML。不会出现交叉提交错误 - 对于 Google
Yes, the subdomain restriction is in the sitemaps.org spec, but, Google has put some exceptions in place:
Verify all subdomains within your Google Webmaster tools account
http://www.google.com/support/webmasters/bin/answer.py?answer=75712
cross-submission of sitemaps XML via Google Webmaster tools - if submitted via the root of your domain - will not throw errors for Google
Within the robots.txt of a subdomain you can point to sitemaps XML on other domains. there will be no cross submission errors - for Google
如果您的网站允许用户在您的网站内创建子域,那么您最好通过创建单个站点地图来为每个子域创建和提交站点地图,从而简化流程。这包括所有子域网站的站点地图 URL 以及将此站点地图保存到单个位置。但是,要做到这一点,所有网站都必须在网站管理员工具中进行验证。您可以将一个站点地图定义为:
http://example.com/sitemap.xml
定义您的所有子站点地图此文档树下所有子域 URL 的域站点地图。
您可以定义多个站点地图文件,每个站点地图最多可包含 50,000 个 URL,文件大小为 10 MB。可以使用 gzip 压缩站点地图以减少带宽。因此,以这种方式定义站点地图不会有任何问题。
If you have a website that allows users to create sub-domain within your site, it is better for you to simplify the process by creating and submitting sitemaps for each subdomains by creating a single sitemap. This includes sitemap URLs for all your subdomain sites and saving this sitemap to a single location. But, to do this, all sites must be verified in webmaster tools. You can define one sitemap as:
http://example.com/sitemap.xml
Define all your sub-domain sitemaps for all your sub-domain URLs under this document tree.
You can define multiple sitemap files upto 50,000 URLs and 10 megabytes file size per sitemap. Sitemaps can be compressed using gzip to reduce the bandwidth. So, you don’t have any problem by defining the sitemap in this way.