Tech Force One is my web log related to technologies, I use day to day.


Search Tech Sites:
Loading

« PHP redirection to HTTPS SSL

If you wish to redirect one of your pages to HTTPS, even when user enters HTTP in the URL, you can use the following lines of code before you load your PHP page.

if (empty($_SERVER['HTTPS']) || ($_SERVER['HTTPS']!=”on”))
{
$redirect= “https://”.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header(“Location:$redirect”);
}

One commentto “PHP redirection to HTTPS SSL”

  • February 8, 2011
    玻尿酸價格 wrote

    You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complex and very broad for me. I’m looking forward for your next post, I will try to get the hang of it!

Leave a comment