technet:dokuwikihttpsredirect
This is an old revision of the document!
Dokuwiki redirect to https
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.1686731141.txt.gz · Last modified: 2023/06/14 10:25 by fk