We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

gbot on 03/25/08


Tagged

secure ssl 443


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

gbot
Nix
withremote
AlastairDewar


force page to ssl


Published in: PHP 


  1. //force redirect to secure page
  2. if($_SERVER['SERVER_PORT'] != '443')
  3. { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit();
  4. }

Report this snippet 

You need to login to post a comment.