Mobile app version of vmapp.org
Login or Join
Connie744

: Google's webmaster tools saying invalid URL in sitemap I've recently made some big changes to my site and as a result, have had to change my sitemap. In doing so, I resubmitted my sitemap

@Connie744

Posted in: #GoogleSearchConsole #Seo #Sitemap

I've recently made some big changes to my site and as a result, have had to change my sitemap. In doing so, I resubmitted my sitemap file only to see 3 errors reading invalid URL's. I'm not sure if it's worth mentioning or not that my sitemap file ins't actually a true XML file. Rather, it's a dynamic php file that the server is tricked into believing is an XML file thanks to modrewrite. This didn't matter last time as I had no sitemap errors. But, this time it is.



The actual sitemap can be found here

The sitemap.php file starts like this:

<?php
require_once("model/functions.php");
require_once("model/model.php");
require_once("model/teams_array.php");

echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.sportannica.com/quickpicks/</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
Continued ............

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

I see the following problems:


Your server return the wrong content type for the sitemap. It returns Content-Type: text/html when it should return Content-Type: application/xml
Your XML sitemap starts with a new line character. This makes the XML document invalid. When I run it through xmllint I get the following error: sitemap.xml:2: parser error : XML declaration allowed only at the start of the document


I doubt that the wrong content type is throwing Google off, but it is probably worth fixing.

The new line at the beginning of the document should be fixed. If you are serving it via PHP it could be caused by PHP header information that you have in the document that doesn't get printed. Once I remove the new line at the beginning, xmllint does not report any more problems.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme