Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Hi guys, I was having a little problem implementing Static Publisher my local Windows machine. The error was a notice that BASE_URL was not being defined and so the static-main.php script jumped to main.php.
My solution was to replace line 45 of static-main.php with this:
$urlSegmentToRemove = str_replace('\\', '/', str_replace('\\\\', '\\', substr($path, strlen(BASE_PATH))));
I don't know if it's the cleaner way to do it but I got it to work that way and doesn't seem to mess anything on a Linux env.
If you have any comments to improve this, they're welcome. Otherwise I hope this can help someone having the same issues.
Thanks, have you submitted the fix via Github for review? No need to clone / fork you could edit the file by hand through the GUI.
The only way to make it cleaner would be to use DIRECTORY_SEPARATOR so that we handle both / and \ (which I assume was your fix?)
Willr, I didn't use DIRECTORY_SEPARATOR on purpouse as to force the path to be normalized using foward slash, since it also works on windows most of the times or at least in this case.
I'll submit it for review.