On Mon, Feb 25, 2008 at 2:09 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> <?
>    if($_SERVER['SERVER_PORT'] != '443') {
>        $url = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] :
> $_SERVER['SERVER_NAME'];
>        header("Location:
> https://".$url.$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']);
>        exit;
>    }
> ?>
>
>

An alternative to this if you don't know the port would be to check
$_ENV["HTTPS"] for "off":

if ($_ENV["HTTPS"] == "off")  ... [insert the rest of Daniel's code here]


-- 
-Dan Joseph

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

Reply via email to