Currently if you have multiple chunks in a sitemap, you currently get sitemap pages like these:
http://example.com/sitemap.xml
http://example.com/sitemap-1.xml
http://example.com/sitemap-2.xml
Note we can't do thing like http://example.com/sitemap.xml/1, etc since as per the specification, links in a sitemap page must not be *above* the location of the sitemap they're in.
Because of this we also have to have special menu items for *each* and *every* sitemap chunk:
$items['sitemap.xml'] = array(
'page callback' => 'xmlsitemap_output_chunk',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'xmlsitemap.pages.inc',
);
$chunks = xmlsitemap_get_chunk_count();
if ($chunks > 1) {
for ($i = 1; $i <= $chunks; $i++) {
$items['sitemap-' . $i . '.xml'] = array(
'page callback' => 'xmlsitemap_output_chunk',
'page arguments' => array((string) $i),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'xmlsitemap.pages.inc',
);
}
}
I'm not sure why I didn't think of this before, but I'm not sure why we can't just use a 'page' query parameter like this:
http://example.com/sitemap.xml
http://example.com/sitemap.xml?page=1
http://example.com/sitemap.xml?page=2
Pros:
- We only need one default menu item to cover all possible sitemap pages.
- We don't need to run a menu rebuild whenever the number of sitemap pages changes.
- Flexible for changes if we need multiple contexts like languages/domains
Cons:
- Not exactly sure if it would be compatible with search engines, but I can't find anything to say it wouldn't.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 704950-xmlsitemap-pages-D6.patch | 2.87 KB | dave reid |
| #2 | 704950-xmlsitemap-pages-D7.patch | 2.81 KB | dave reid |
Comments
Comment #1
dave reidI posted http://www.google.com/support/forum/p/Webmasters/thread?tid=359f790708a4... to see if I can get an answer.
Comment #2
dave reidInitial patches for D6 and D7 attached.
Comment #3
dave reidI'm testing this on my own site since I can't seem to get a good answer from anyone at Google. I really wish I had a person I could contact that knew about the specifics of Google Webmaster Tools.
Comment #4
dave reidJust submitted to Webmaster tools and it was fine. I think I'm going to go ahead with this change.
Comment #5
dave reidCommitted to both branches.
http://drupal.org/cvs?commit=324728
http://drupal.org/cvs?commit=324730