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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

FilesystemPublisher $static_base_url woes

Go to End

2 Posts   1790 Views


Community Member, 5 Posts

4 November 2010 at 1:03pm

Edited: 04/11/2010 1:04pm

I've been working with the FilesystemPublisher and the RsyncMultiHostPublisher and have come across a problem that I am hoping has an easy answer.

I am able to generate the static html files fine with a /dev/buildcache, however I would like to deploy the files on a machine with a different base_url. When the files are coped to another host, the base_url specified in all the pages still refer to the original host. From the API docs, the FileSystemPublisher::set_static_base_url() function would seem to do the right thing.

When I set this, all the links in the static files point to the right place, but the content portion of every page simply contains a "Page not found" error. It looks like when it goes to fetch the page to write to the cache, the static_base_url setting is screwing things up.

Has anyone else come across this? Is there something that I am missing about the proper way to use this?



Community Member, 5 Posts

5 November 2010 at 12:52pm

Nobody seems to have replied, and after examining the code, I can't see how the static_base_url setting could work at all. Every time it is set to something other than the proper value, the URL's are properly rewritten however the content of the page is always "Page no found". So it looks like the functionality became broken sometime between 22/10/08 when it was introduced for the DNC site, and now. Maybe it worked fine in SS 2.2.1?

I've modified the FilesystemPublisher module to do a very simple string replace on the old baseUrl to the new one, if a static_base_url is defined. Does anyone have a better way to get this functionality to work?