- for section, site in sitemaps.items():
- if callable(site):
- pages = site().paginator.num_pages
- else:
- pages = site.paginator.num_pages
- sitemap_url = urlresolvers.reverse('sitemap_section_index', kwargs={'section': section})
- sites.append('%s%s' % (settings.APP_URL, sitemap_url))
+ for section in sitemaps.keys():
+ sitemap_url = urlresolvers.reverse('sitemap_section_index', prefix='/', kwargs={'section': section})
+
+ # Replace double forward slashes with single ones
+ final_url = '%s%s' % (settings.APP_URL, sitemap_url)
+ final_url = re.sub("/+", "/", final_url)
+ final_url = final_url.replace('http:/', 'http://')
+ final_url = final_url.replace('https:/', 'https://')
+
+ sites.append(final_url)