We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum


Thread tagged as: Question, Problem

How to create an xml sitemap in Runway using different file extensions

I've used this technique many times in Perch, but am not sure how to implement it in Runway.

Creating a sitemap: https://docs.grabaperch.com/perch/content/functions/how-do-i-create-a-google-sitemap/

and Using Different File Extensions to have the file as sitemap.xml: https://docs.grabaperch.com/perch/getting-started/file-extensions/

My problem is that my sitemap.xml file is in perch/templates/pages/ but when I go to add a page called 'Google Sitemap' I cannot see the sitemap.xml file presumably because it's .xml

How should this be done in Runway?

Simon Clay

Simon Clay 127 points

  • 2 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

Simon, I think because all pages are passed through the Runway routing engine, you can be a bit sneaky about it - I personally create a sitemap.php page in the pages folder, with the header('Content-type: application/xml'); line. I then create a Sitemap page in Runway admin, point to the sitemap.php master page, but in "Page Options", change the path to /_sitemap.xml. Browse to domain.com/_sitemap.xml and it works - I've not had an issue with this...

This is what I do https://www.cvwdesign.com/blog/creating-google-sitemaps-with-perch

I don't actually have the sitemap page in Runway but it is a .php page.

Duncan Revell

Duncan Revell 78 points
Registered Developer

And of course, with Runway 3, you can create a route to a master page, so that would also do away with the need to actually create a page.