Forum
Sitemap error after upgrading to Runway
I have successfully upgraded a Perch site to Runway but the previously working xml site map is giving an error. Having setup using the guide for Perch: https://docs.grabaperch.com/perch/content/functions/how-do-i-create-a-google-sitemap/
Error:
This page contains the following errors:
error on line 11 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
Sitemap.xml:
header('Content-type: application/xml');
include('admin/runtime.php');
perch_pages_navigation(array(
'template'=>'sitemap.html',
'from-path' => '/',
'hide-extensions' => true,
'flat'=>true
));
Tried removing below but no joy:
include('admin/runtime.php');
Any ideas, urgently need to fix this please?
What's on line 11?
Just an empty line, if I delete that so the last line is the close php tag I get this error:
I'm running 3.0.2 Runway
Sitemap template code:
You need to look at line 11 of the output, not line 11 of the PHP source.
How do I do that? I've also tried enabling debug but nothing displays when .xml
If I change the file to .php extension and comment out the content type xml then the sitemap displays correctly no errors.
Did you have an .htaccess file that was enabling xml to be parsed as PHP? Is it still there?
I did have this:
I've added it back into the .htaccess file and now the page won't load:
You should speak to your server admin - this isn't anything to do with Perch.
OK thanks for your help, just thought as it worked before upgrading perch to runway that it was that. I've used the following to get it working for now until I understand what's changed from running Perch.
in my .htaccess file:
in my sitemap.php file: