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?

user811416
  • 205
  • 1
  • 2
  • 11

2 Answers2

1

Steve finds the right link. Just need to find all urls in /local/config.php and modify them as follows:

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

No need to modify the http:// links in your webpages. I have not done further research. I guess the code means: if the page is requested via https, the related url become https links.

More detailed explanations are welcome.

user811416
  • 205
  • 1
  • 2
  • 11
0

According to PmWiki.PathVariables and WikiFarms, the $FarmPubDirUrl and the related $FarmD variables are the ways PmWiki refers to static content.

Dfaure
  • 564
  • 7
  • 26
  • The `$UrlScheme` variable is the PmWiki way prefered way to handle this. You may use the following code: `$FarmPubDirUrl = $UrlScheme . '://www.example.com/~someuser/pmwiki/pub';` – Dfaure Jul 15 '15 at 07:55