New HTTPS Redirect Method

Machine-translated (anthropic, claude-haiku-5-5) from the Chinese original. Read the original in 中文

A new HTTPS redirect method: it's faster, requires no pseudo-static (rewrite) rules, and you only need to add the code to header.php. The code is as follows:

text
<?php
 if ($_SERVER["HTTPS"] <> "on")
{
    $xredir = "https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    header("Location: ".$xredir);
}
?>

Comments