[pmwiki-users] HTTP not being detected properly

Joshua J. Kugler joshua at eeinternet.com
Fri Jul 17 12:27:24 CDT 2015


Thanks for the tip. I found this in farmconfig.php

$ScriptUrl = 'http://' . $_SERVER['SERVER_NAME'];

Which apparently sets it, even after pmwiki.php already (correctly) sets it.  
Still a few things not rendering correctly due to, apparently, "http" being 
hard-coded in a few places (mostly notably in the links to assets (graphics 
and CSS files).  I'll have to work those out.

j

On Friday, July 17, 2015 12:09:33 Petko Yotov wrote:
> You can (re)define the full $ScriptUrl variable near the top of
> config.php:
> 
>    $ScriptUrl = "https://www.example.com"; // or possibly
>    $ScriptUrl = "https://www.example.com/pmwiki/pmwiki.php";
> 
> If that doesn't help, it is possible that some local configuration file
> or a recipe is resetting the $ScriptUrl variable: search for it and
> fix/remove it.
> 
> Petko
> 
> On 2015-07-17 02:02, Joshua J. Kugler wrote:
> > I am trying to serve PmWiki over HTTPS.  Even though phpinfo() reports
> > that
> > _SERVER["HTTPS"] is 'on' and the port is 443. ScriptUrl is still being
> > set to
> > http://<hostname> Any ideas?
> > 
> > The code is:
> > 
> > $UrlScheme = (@$_SERVER['HTTPS']=='on' ||
> > @$_SERVER['SERVER_PORT']==443)
> > 
> >              ? 'https' : 'http';
> > 
> > $ScriptUrl =
> > $UrlScheme.'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
> > 
> > And phpinfo output:
> > 
> > _SERVER["HTTPS"]	on
> > _SERVER["SERVER_PORT"]	443
> > 
> > But putting $ScriptUrl in a page still gives me:
> > 
> > http://my.host.name
> > 
> > j
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com - Fairbanks, AK
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A



More information about the pmwiki-users mailing list