|
PITS /
00527Summary: Automatically detect https: server
Created: 2005-09-16 16:14
Status: Closed - added for 2.2.0-beta18
Category: CoreCandidate
From: Pm
Assigned:
Priority: 55555 3
Version: 2.0.6
OS:
Description:
Currently PmWiki's preamble that sets A wiki administrator can always explicitly set the value of We can either have PmWiki try to automatically determine when it's running via SSL (although it could guess incorrectly), or perhaps we should add a note to sample-config.php (which could confuse people doing first-time installations). Ideas? See also PITS:00526 for a related issue.
I'm doing something like this in one of our PHP applications: $auto_base_url = 'http';
if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on') {
$auto_base_url='https';
}
I was not notified of any problems with this yet, but ymmv - perhaps our users just don't use https :). But if it doesn't work, people could still set the variables directly. Balu I've changed the appropriate code in pmwiki.php (line 71) to This works like a charm - so maybe you could apply some of these code to the code repository and add it to the next release. Delete my own posting, cause relative addressing is already discussed in PITS:00526 The snippet from Balu is more correct, because when php runs on IIS (Windows) Angelo |