Hello,
I have domain.it and domain.com, where domain.it is the default site and domain.com the translated one.
When i create a multilanguage sitemap, everything works fine, except if i tick the "add a stylesheet" option.
The domain.com sitemap opened in the browser displays an error, with firefox ranting about the impossibility to open the stylesheet, but the source code is (almost) fine...
The problem is that it tries to add the stylesheet from the .it domain, like this:
<?xml-stylesheet type="text/xsl" href="http://www.domain.it/sitemap.xsl"?>
Using domain.com solves the issue.
It should be an easy thing, and i can try to fix it if you dont have time.. just point me to the right functions to save some time =)
Comment | File | Size | Author |
---|---|---|---|
#11 | 1276232-wrong-stylesheet-with-multiple-domain-xmlsitemaps.patch | 561 bytes | matglas86 |
Comments
Comment #1
xamount CreditAttribution: xamount commentedI can confirm that this bug happens to me as well. Same exact scenario. Subscribing.
Comment #2
Dave ReidMarked #1276232: wrong stylesheet with multiple domain xmlsitemaps as a duplicate of this issue.
Comment #3
entuland CreditAttribution: entuland commentedHello,
this happened to me too in a multi-domain installation, using version 6.x-2.0-rc1.
In that version the issue seems to be in the file xmlsitemap/xmlsitemap.xmlsitemap.inc, line 65, inside of this function:
The call to
url('sitemap.xsl')
systematically outputs "http://domain.it/sitemap.xsl", whereas depending on the sitemap I needed stuff like "http://domain.de/sitemap.xsl", "http://domain.co.uk/sitemap.xsl" and so forth.I changed that line to this:
I thought it would end up with the full URLs mentioned above, but it simply outputted "/sitemap.xsl" which works quite well in any case for all of my domains.
I don't know if this fix is acceptable and if it applies also to the 7.x branch, in any case I wanted to share.
Thanks a lot for a very useful module despite of this minor glitch.
Comment #4
darthf1 CreditAttribution: darthf1 commentedThis bug still occurs for me in 7.x-2.0-rc1
Comment #5
darthf1 CreditAttribution: darthf1 commentedComment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedCan someone turn the #3 change into a proper patch to get the test bot attention?
Comment #7
Dzhebarov CreditAttribution: Dzhebarov commentedI confirm that the #3 change works for me in 7.x-2.x-dev
Comment #8
darthf1 CreditAttribution: darthf1 commentedI confirm that the #3 change works for me in 7.x-2.x-dev
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedNo patches attached. Resetting status to active.
I understand #3 gives a solution but that solution isn't a formal patch so the Reviewed and tested status isn't correct.
Comment #10
jasom CreditAttribution: jasom commentedAfter #3 (I changed line 60 in xmlsitemap/xmlsitemap.xmlsitemap.inc to $this->writePi('xml-stylesheet', 'type="text/xsl" href="' . url('sitemap.xsl', array("language" => $this->sitemap->context["language"])) . '"'); ) and I still see message:
It shold be "site.cz" not "site.com". I have 7.x-2.0-rc2.
Comment #11
matglas86 CreditAttribution: matglas86 commentedI had the same problem. The sitemap value has all values needed for the options in url(). So here is the patch.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedLooks good to me.
Comment #13
jasom CreditAttribution: jasom commentedI applied patch, updated cached files, rebuilt links, fixed .htaccess redirect to www version, cleared caches and it WORKED! Thank you.
Czech version on site.cz/sitemap.xml si working again, but I don't understand why I have "Page not found" message on site.com/sitemap.xml (default language sitemap).
Update:
Even "page not found" error was removed by #14 on #1104746: sitemap.xml not found (Error 404). Dave or Earnie, please, take a look at #14 and #15.
Drupal has great comunity.
Comment #14
yce CreditAttribution: yce commented#11 Thanks! It worked for me for 7.x-2.0-rc2 version.
Comment #15
Dave ReidCommitted #11 to 7.x-2.x. Thanks and sorry for the wait.
http://drupalcode.org/project/xmlsitemap.git/commit/8bf0985
Comment #16
Dave ReidLooks like it applied to 6.x-2.x as well, so I backported it as well.
http://drupalcode.org/project/xmlsitemap.git/commit/aa208a7
Comment #18
Chris Burge CreditAttribution: Chris Burge commentedThis commit causes issues with HTTP/HTTPS sites as is described in #2244449: Use Protocol-less URL for XSL File.