Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't work if ProcessWire is installed in a subdirectory #11

Closed
FlipZoomMedia opened this issue Jan 9, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@FlipZoomMedia
Copy link
Contributor

commented Jan 9, 2014

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:
https://dev.flipzoom.de/ - works

If PW is installed in the subdirectory:
https://dev.flipzoom.de/2013-processwire/ - 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 "/2013-processwire/" instead of "/".

Best regards,
Dave

@FlipZoomMedia

This comment has been minimized.

Copy link
Contributor Author

commented Jan 9, 2014

Should solve 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'])));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.