HTTP to HTTPS php redirect?
I am trying to get a page on my site to redirect to an https site. My site is an http.
I tried this code:
<?php
if ($_SERVER['SERVER_PORT']!=443)
{
$url = "https://www.securesite.com". $_SERVER['SERVER_NAME'] . ":443".$_SERVER['REQUEST_URI'];
header("Location: $url");
}
?> so after it has redirected, in the browser it looks like this
https://thesecuresite.com:443/redirect.php
I tried another one I found but it did the same thing, without the 443. Just he mysite.com/redirect.php on the end.
Any thoughts?
Bored. Learn everything you need to know about Organic Gardening.