Double slashes in sitemap file url
« on: November 27, 2013, 09:52:13 PM »
Hi,

I have just installed the generator and got it to generate a sitemap for one of my sites.  It is mostly fine except for extra forward (and backward) slashes in the URL for the actual sitemap file and for the xsl file linked in the sitemap.

The start of my sitemap.xml looks like this - I have highlighted the error

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="http://devui03.ct.xmlsitemapgenerator[color=red][b]//[/b][/color]pages/mods/sitemap.xsl"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
   

And in the generator web page I see a similar thing - see attached screenshot.

I couldn't find anything in the doco or config to fix this.  Any suggestions on how to fix this?

Cheers,

James.
Re: Double slashes in sitemap file url
« Reply #1 on: November 28, 2013, 10:17:35 PM »
I fixed this one too, I think.

I have my generator site/code in a separate directory to my sites to keep things cleaner.  Because of this, the url for the xsl file for the sitemap was pointing to the wrong location.  I edited sitemap_xml_tpl.xml and sitemap_index_tpl.xml to get it to point to where I wanted the xsl. 

From this:
Code: [Select]
<?xml-stylesheet type="text/xsl" href="%GEN_URL%pages/mods/sitemap.xsl"?>


To this:
Code: [Select]
<?xml-stylesheet type="text/xsl" href="%GEN_URL%sitemap.xsl"?>

I also had to add a folder under my site root that was the same as the site root folder name for the generator.  I didn't go looking for where %GEN_URL% is set to try and remove it there. So my sitemap.site1.xml is at /siteroot/sitemap.site1.xml and the sitemap.xsl is under /siteroot/generatorname/sitemap.xsl
Re: Double slashes in sitemap file url
« Reply #2 on: November 29, 2013, 05:27:44 AM »
I took this one step further to save having to mess around with my deployment process.  I removed the line

Code: [Select]
<?xml-stylesheet type="text/xsl" href="%GEN_URL%pages/mods/sitemap.xsl"?>

and that way I didn't need to add extra files and  directories to my deployment package.  The sitemap is only read by a bot and it isn't interested in style sheets.
Re: Double slashes in sitemap file url
« Reply #3 on: December 02, 2013, 01:59:52 PM »
Hello,

there is a "Enable stylesheet for XML sitemap" setting that can be turned off in advanced generator configuraiton section.
Re: Double slashes in sitemap file url
« Reply #4 on: December 03, 2013, 08:58:00 PM »
Thanks for that Oleg.  I had not seen the setting.