$current = $_SERVER['DOCUMENT_ROOT']; $http = "httpdocs"; $https = "httpsdocs"; $base = "http://www.ppslc.com"; $check = strstr ($current, $https); if ($check) { $newurl = $base.$_SERVER['PHP_SELF']; header("Location: $newurl"); } ?>