Redirect to https
Posted: 30 Apr 2009, 21:53
Here's a snippet of code that I am using to redirect http request to the https version of the site. I had to use this to avoid using .htaccess method of redirection. Add this code to core.php right after the ob_start ('compress_handler' ) call:
Code: Select all
if ( isset ( $_SERVER['HTTPS'] ) != 'on' ) {
$g_header="https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URL'];
header( "Location: " . $g_header );
}