Filip Kasaj

“inner strength as space”

User Tools

Site Tools


technet:dokuwikihttpsredirect

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
technet:dokuwikihttpsredirect [2023/06/14 10:25] – created fktechnet:dokuwikihttpsredirect [2023/06/14 10:26] (current) fk
Line 1: Line 1:
 +====== Dokuwiki redirect to https ======
 +
 +
 If redirect from http to https is need and there is no success via .htaccess then PHP can help us: 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' '…lib/tpl/template-name/main.php'
 +
 +<code php [enable_line_numbers="true"]>
  
 if ($_SERVER['HTTP_HOST'] != 'localhost' and $_SERVER['HTTP_X_FORWARDED_PROTO'] != "https") { if ($_SERVER['HTTP_HOST'] != 'localhost' and $_SERVER['HTTP_X_FORWARDED_PROTO'] != "https") {
Line 9: Line 14:
     exit;     exit;
 } }
 +
 +</code>
  
 Inspired by https://www.dokuwiki.org/tips:httpslogin Inspired by https://www.dokuwiki.org/tips:httpslogin
technet/dokuwikihttpsredirect.1686731111.txt.gz · Last modified: 2023/06/14 10:25 by fk