Static Publishing and HTTPS

余生长醉 提交于 2019-12-14 03:55:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!