Closed fbrnc closed 9 years ago
Hmm.. does sound like an issue with sitemap.. i'll have to look at that one. thanks.
Workaround: Create a page "sitemap" that will prevent the onPageNotFound event being fired. The actual page content will be ignored and the sitemap will be rendered correctly.
I have a better solution that will fix this + error page.. see the commits
I'm realizing now that setting the header (see pull request #1) has a side effect: The sitemap plugin is also returning a status code 404 now. I guess even though the sitemap is hijacking the output (don't know exactly how it hook into the request lifecycle), Grav still tries to render a page, won't fine it, triggers the error plugin and sets the 404 header.
Not sure how to proceed, but the main problem seems to be that in case onPageNotFound event shouldn't be fired in case of the sitemap.