kjvarga / sitemap_generator

SitemapGenerator is a framework-agnostic XML Sitemap generator written in Ruby with automatic Rails integration. It supports Video, News, Image, Mobile, PageMap and Alternate Links sitemap extensions and includes Rake tasks for managing your sitemaps, as well as many other great features.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested indexing This Sitemap Index is referenced by another Sitemap Index.

wildjcrt opened this issue · comments

I use this gem on my site to create sitemap files for search engine.
In google webmaster tools hint me that "Nested indexing This Sitemap Index is referenced by another Sitemap Index."

I see README providing example:

  • public/sitemap_index.xml.gz

    <?xml version="1.0" encoding="UTF-8"?>
    <sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">
      <sitemap>
        <loc>http://www.example.com/sitemap1.xml.gz</loc>
      </sitemap>
    </sitemapindex>
    
  • public/sitemap1.xml.gz

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
      <url>
        <loc>http://www.example.com/</loc>
        <lastmod>2011-05-21T00:03:38+00:00</lastmod>
        <changefreq>always</changefreq>
        <priority>1.0</priority>
      </url>
      <url>
        <loc>http://www.example.com/sitemap_index.xml.gz</loc>
        <lastmod>2011-05-21T00:03:38+00:00</lastmod>
        <changefreq>always</changefreq>
        <priority>1.0</priority>
      </url>
      <url>
        <loc>http://www.example.com/welcome</loc>
        <lastmod>2011-05-21T00:03:38+00:00</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.5</priority>
      </url>
    </urlset>
    

But Sitemap errors - Webmaster Tools Help also answer for "Incorrect Sitemap index format: Nested Sitemap indexes" needing to remove entries pointing other Sitemap index files.

I find the sitemap1.xml having the Sitemap indexes entry line.
How to solve this sitemap error ?

Hi there,

That's the first report I've had that this is not a good practice. So I would consider turning it off by default if that is in fact the case. You can turn it off with:

SitemapGenerator::Sitemap.include_index = false

Can you try that and then confirm that after that change Google reports no sitemap errors?

Thanks for your answer. I refresh my sitemap complete, and I'll observe the google webmaster tools report.

Hi kjvarga

The google webmaster tools' index error has disappeared. Nice!
Close issue.

Thanks for confirming that! But hold on. I'm going to leave the issue open till I make this the new default.

Ok as of v3.2 this is the new default. I had a feeling the include_root and include_index options where going to be more trouble than they were worth, but once it was out I didn't want to mess with it.

sorry could you clarify what this does? does this mean when it generates a sitemap it doesnt include the root url?

No it will still include the root URL, but not the sitemap index URL.
include_root still defaults to true
On Aug 10, 2012 8:59 AM, "Travis" notifications@github.com wrote:

sorry could you clarify what this does? does this mean when it generates a
sitemap it doesnt include the root url?


Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-7648774.