note 52827 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Sat, 14 May 2005 16:36:01 +0000 |
| Subject: | note 52827 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-89429@lists.php.net to get a copy of this message | ||
Note Submitter:
Reason: useless
----
I found this simple way to switch from http in https
if ($_SERVER['SERVER_PORT']==80) {
$newurl='https://'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI'];
header("Location: $newurl");
}
if ($_SERVER['SERVER_PORT']==443) {
$newurl='http://'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI'];
header("Location: $newurl");
}