Hi everyone, this is my first post. I am having trouble with a redirect I am trying to put on an a page of mine. I need to redirect visitors from my site, which is an http site, to an https page on another site.
I can get it to redirect to the desired https page, but it appends this on the the end of the url:
Here is the code I am using.
Code: Select all
<?php
if ($_SERVER['SERVER_PORT']!=443)
{
$url = "https://securesite.com". $_SERVER['SERVER_NAME'] . ":443";
header("Location: $url");
}
?>
So when it redirects the URL looks like this:
- https://securesite.commyhttpsite.com:443
Can anyone help me? I have just started to get into php, like a week ago, and I thought I could do this as it would be easy!
Thanks