1

We have a website whose home page is http://bigbird.comp.nus.edu.sg/pmwiki/farm/appl/index.php As you see, it is based on pmwiki.

We find CSS, JS and other resources are loaded over http. That is because links generated by pmwiki's php files are prepended with http://. We want to remove the prepended http://. Links will become like:

<script src="//example.com/script.js"></script>

Which pmwiki's php files should we modify?

4

2 回答 2

1

史蒂夫找到了正确的链接。只需要找到所有的url /local/config.php,修改如下:

if ($_SERVER["HTTPS"] == 'on') {
  $FarmPubDirUrl = 'https://www.example.com/~someuser/pmwiki/pub';
} else {
  $FarmPubDirUrl = 'http://www.example.com/~someuser/pmwiki/pub';
}

无需修改http://网页中的链接。我没有做进一步的研究。我猜代码的意思是:如果页面是通过 请求https的,相关的 url 就会变成https链接。

欢迎更详细的解释。

于 2014-10-09T07:56:19.190 回答
0

根据PmWiki.PathVariablesWikiFarms$FarmPubDirUrl和相关$FarmD变量是 PmWiki 引用静态内容的方式。

于 2015-02-13T13:22:45.023 回答