Hi David
When i go to example.com/sitemap.php i get this error:
XML Parsing Error: XML or text declaration not at start of entity
Location: https://www.example.com/sitemap.php
Line Number 2, Column 1:
I have tried to submit the sitemap to google console and it says discovered urls is 0
any ideas how i fix this.
thanks
paul
Hi David
This what i have in my sitemap.php
<?php
require("includes/common.php");
header("Content-Type: text/xml");
{code saved}
?>
Hi Paul,
The PHP section is self contained but what is important is nothing before the opening <?php tag or after the closing ?> tag but it looks like that may be the case so the other possibility is that your text editor may have added "Byte Order Markers" (BOM) at the top of the file. To check if this is the case, open the file in your text editor, make and undo a change and then use File > Save As and on the dialog look for character encoding drop down and you may find an option something like "UTF-8 No BOM". Alternatively, it might be a menu function whilst editing, in which case select do disable BOM, make and edit and then re-save the file...
Cheers,
David.
--
PriceTapestry.com
Hi David
Tried the below in notepad++
{link saved}
still getting the error.
thanks
Paul
Hi Paul,
That sounds like the same issue you had on another site where white space had crept into your sitemap.php causing a blank line at the start of the output - if you edit the file and check that there is nothing outside of the opening and closing PHP tags that should be all it is;
Bear with me on your other posts regarding parking / multiple domains pointing to sub-sections of a different installation I'll work out the best approach and post those shortly...
Cheers,
David.
--
PriceTapestry.com