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

edge cases not handled for subfolder installations #196

Open
joyously opened this issue Jul 21, 2022 · 0 comments
Open

edge cases not handled for subfolder installations #196

joyously opened this issue Jul 21, 2022 · 0 comments

Comments

@joyously
Copy link
Contributor

https://github.com/leonstafford/static-html-output/blob/10cf1af363a07c90d1bec426f7db99f40cadfff9/src/WPSite.php#L327

When WP is installed in a subfolder, however deep, the count of folders cannot be found just from parse_url. The site could be multisite, with its different structure, or the content folder could be moved.
Especially on localhost, the WP folder could be several folders deep.

A better method would be to get the difference between the home URL and the content URL(shows if content is in subfolder), or between home URL and site URL (shows if WP is in subfolder).

Using parse_url on localhost returns the subfolder as part of the path, so generating crawling URLs is incorrect. My home URL is set to http://localhost/testsite and the crawl list has /testsite/2020/05/05/ whereas the other paths do not start with testsite .
This is after I changed the parse_url call in FilesHelper.php (in getAllWPPostURLs).
Generating a site, I end up with posts at the top level, but duplicated under a testsite folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant