问题
Following this question : Static Publishing in Silverstripe on Large Sites
We've been implementing the module from this fork (https://github.com/Focus-Flow/silverstripe-staticpublishqueue/) and it's working great locally. We have done some modification to implement our own categories page, but nothing special.
The only issue is now when we test on our server, which use https rather than http in local, nothing is working anymore. I've been trying to change a couple of thing in the FileSystemPublisher.php file to use https rather than http, but it's not doing anything.
An other thing, and it might be linked, when I go in the admin backend of our subsites, all the page links in the edit page are in "http" and apparently there is a https redirection on the server.
So I guess I have two questions :
How to make static publishing queue work with https ?
How to make silverstripe understand that all of the website page should be in https and not in http, so it shows this way in the admin backend ?
Thanks in advance.
回答1:
Subsite
has a method called absoluteBaseURL()
, so you might try this in your Page_Controller::init()
:
$currentSubsite = Subsite::currentSubsite();
Director::setBaseURL($currentSubsite->absoluteBaseURL());
Of course you need to configure Subsite's Domains including https
来源:https://stackoverflow.com/questions/47445960/static-publishing-and-https