具有大量动态子域的站点的站点地图

发布于 2024-09-26 15:07:26 字数 876 浏览 11 评论 0原文

我正在运行一个允许用户创建子域的网站。我想通过站点地图将这些用户子域提交给搜索引擎。但是,根据站点地图协议(和 Google 网站管理员工具),单个站点地图只能包含来自单个主机的 URL。

最好的方法是什么?

目前我有以下结构:

  1. 站点地图索引位于 example.com/sitemap-index.xml,列出了每个子域的站点地图(但位于同一主机)。
  2. 每个子域都有自己的站点地图,位于 example.com/sitemap-subdomain.xml(这样站点地图索引仅包含来自单个主机的 URL)。
  3. 子域的站点地图仅包含来自子域的 URL,即 subdomain.example.com/*
  4. 每个子域都有 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:

  1. Sitemap index located at example.com/sitemap-index.xml that lists sitemaps for each subdomain (but located at the same host).
  2. 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).
  3. A sitemap for a subdomain contains URLs from the subdomain only, i.e., subdomain.example.com/*
  4. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱格式化 2024-10-03 15:07:26

我最近为此苦苦挣扎,终于成功了。有关详细信息,请参阅此帖子:

http://www .google.com/support/forum/p/Webmasters/thread?tid=53c3e4b3ab8d9503&hl=en&fid=53c3e4b3ab8d9503000497bd04ba63cf

摘要:

  • 使用 DNS 验证 一次性验证您的网站及其所有子域,
  • 使所有子域上的 robots.txt 指向主站点地图在您的 www 域上
  • 您可能需要等待几天,Google 才能更新您所有子域上的 robots.txt 缓存副本。在那之前它仍然会显示错误。

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:

  • 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.
太阳公公是暖光 2024-10-03 15:07:26

是的,子域名限制位于 sitemaps.org 规范中,但是 Google 已实施了一些例外情况:

  1. 验证您的 Google 网站站长工具帐户中的所有子域名
    http://www.google.com/support/webmasters/bin /answer.py?answer=75712
    通过 Google 网站管理员工具交叉提交站点地图 XML - 如果通过您的域的根提交 - 不会引发 Google 错误

  2. 在子域的 robots.txt 中,您可以指向其他域上的站点地图 XML。不会出现交叉提交错误 - 对于 Google

Yes, the subdomain restriction is in the sitemaps.org spec, but, Google has put some exceptions in place:

  1. 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

  2. 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

猫瑾少女 2024-10-03 15:07:26

如果您的网站允许用户在您的网站内创建子域,那么您最好通过创建单个站点地图来为每个子域创建和提交站点地图,从而简化流程。这包括所有子域网站的站点地图 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文