technet:dokuwikihttpsredirect
This is an old revision of the document!
If redirect from http to https is need and there is no success via .htaccess then PHP can help us:
'…lib/tpl/template-name/main.php'
if ($_SERVER['HTTP_HOST'] != 'localhost' and $_SERVER['HTTP_X_FORWARDED_PROTO'] != “https”) {
$location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $location);
exit;
}
Inspired by https://www.dokuwiki.org/tips:httpslogin
technet/dokuwikihttpsredirect.1686731111.txt.gz · Last modified: by fk
