djangohttpsschemasitemaplines-of-code

Django Sitemap Generates https:// in loc TWICE in Development


The example.com/sitemap.xml is returning loc with double https:// making the generated sitemap to be incorrect/unacceptable.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://https://example.com</loc>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>

I've tried changing the protocol in the sitemaps.py file from https to http but that only appends http:// in front of the https://example.com/.

Any ideas?


Solution

  • My solution:

    I went into the admin panel and renamed the site. This time without the protocol in front.