Skip to content

edge cases not handled for subfolder installations #196

Description

@joyously

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions