SSL Redirect
I am currently working on a new website and installed PS4.5. I enabled SSL Shared certificate with my host. I am trying to redirect all traffic to https:// , but PS4 will not redirect without errors. I am not aware of any .htaccess folders in my root directory. I was trying to include the following php code at the top of my index.php page to redirect traffic to https://
<?php
// If page requires SSL, and we're not in SSL mode,
// redirect to the SSL version of the page
if($_SERVER['SERVER_PORT'] != '443') {
header('Location: www.yourssladdress.com');
exit();
}
?>
What am i doing wrong? I want visitors to go straight to a https:// site.
************ Solution - Thanks Jason *******************
After reading about the blank space problem I looked at the code again. The code was correct, but I had a space between the above "<?Php" script and another. Wierd, but I removed the space and the webpage works great! - Thanks again.
**************************************************