Hi guys,
I think i found a bug in this module. There is no Sitemap generated when ProcessWire is installed in a subfolder relative to the root directory.
For example:
If PW is installed in direct root: www.flipzoom.de - works
If PW is installed in the subdirectory: www.flipzoom.de/pw203/ - does not work; trigger a 404
The problem is on line 42 in the MarkupSitemapXML.module.
$startpage = $this->sanitizer->path(dirname($_SERVER['REQUEST_URI']));
The variable $startpage returns "/pw203/" instead of "/".
The following should fix the problem.
Replace line 42
$startpage = $this->sanitizer->path(dirname($_SERVER['REQUEST_URI']));
with
$startpage = str_ireplace(trim(wire('config')->urls->root, '/'), '', $this->sanitizer->path(dirname($_SERVER['REQUEST_URI'])));
Best regards,
Dave