Even though we have about 6 different domains and languages configured, the function xmlsitemap_sitemap_uri() returns the same value for every language/domain. Even if we delete the 'xmlsitemap_base_url' variable, it still uses the one global base_url of the current site you are looking at. This causes all sitemaps in the list to look like this:

http://mysite.com
http://mysite.com (korean)
http://mysite.com (japanese)

Instead of looking like this:
http://mysite.com
http://mysite.ko (korean)
http://mysite.jp (japanese)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zhuber’s picture

FileSize
973 bytes

The following patch allows each language/domain to have a separate base URL for the sitemap URI.

zhuber’s picture

Assigned: zhuber » Unassigned
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: xmlsitemap-2492433.patch, failed testing.

zhuber’s picture

Status: Needs work » Needs review
FileSize
793 bytes
Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch in #4 to xmlsitemap.module does not apply to the latest xmlsitemap 7.x-2.x-dev and if still applicable needs a reroll.

Checking patch xmlsitemap.module...
error: while searching for:
  $uri['path'] = 'sitemap.xml';
  $uri['options'] = module_invoke_all('xmlsitemap_context_url_options', $sitemap->context);
  drupal_alter('xmlsitemap_context_url_options', $uri['options'], $sitemap->context);
  $uri['options'] += array(
    'absolute' => TRUE,
    'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']),
  );
  return $uri;
}

error: patch failed: xmlsitemap.module:522
error: xmlsitemap.module: patch does not apply
sam.spinoy@gmail.com’s picture

askovdal’s picture

FileSize
782 bytes

Patch for version 2.6

amit.drupal’s picture

Patch #6 and Patch #7 both are similar.

rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

The last submitted patch, 6: xmlsitemap-2492433-6.patch, failed testing. View results

arpas’s picture

Patch #6 can be applied to version 7.x-2.6 but will overwrite global base_url!
Function xmlsitemap_sitemap_uri in module version 7.x-2.6 is using global $base_url; so patch must be updated to prevent global base_url overwrite.

poker10’s picture

Status: Needs review » Needs work

As mentioned in #11, the last patches are wrong, as they overwrite global base_url. Switching to Needs Work.