Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Google Sitemap.xml on Live Site

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1526 Views
  • mathiasmex
    Avatar
    Community Member
    28 Posts

    Google Sitemap.xml on Live Site Link to this post

    Hi all,

    maybe someone out there could point me in the right direction:

    Google sitemap.xml is working fine on local machine, but not on live site.
    Just get "parse error". Does anyone know if this is related to execution time or similar ? Or am I missing something after going live with my site ?

    Would love to get a hint.

    Thanks in advance,

    mathiasmex

  • LinseyM
    Avatar
    Community Member
    99 Posts

    Re: Google Sitemap.xml on Live Site Link to this post

    Hi there,

    Am getting this error too.

    Using SS v2.4.0 in Firefox and when I call http://www.my-domain.com/sitemap.xml I get the following error:

    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.deesidetimberframe.com/sitemap.xml
    Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>

    Did you get this sorted out?

    Many thanks,

    Linsey

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Google Sitemap.xml on Live Site Link to this post

    That would suggest to me that white space is being output before "<?xml version="1.0" encoding="UTF-8"?>" becasue it says "Line Number 2" and it should the very first thing in the xml file. check your template googlesitemaps\templates\GoogleSitemap.ss and also look for trailing spaces in the your php files.

  • Xurk
    Avatar
    Community Member
    50 Posts

    Re: Google Sitemap.xml on Live Site Link to this post

    We were experiencing this same problem out of the blue this morning for an existing website and I stumbled upon this thread in my search for a solution. Thanks to this and a post in another thread on the same subject, I was able to solve the problem.

    In my case, it was two "new lines" after the closing PHP tag in a custom page within the "mysite" directory. So I can confirm looking through all of the .php files in search of trailing whitespace is most likely the way to fix this

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Google Sitemap.xml on Live Site Link to this post

    with Silverstripe being MVC there is no need for a closing tag at all in your code... I advise not using them to avoid this...

    1526 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.