Page 1 of 1

Redirect to https

Posted: 30 Apr 2009, 21:53
by t3knoid
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 );
}

Re: Redirect to https

Posted: 29 Jul 2009, 14:49
by Kirill
What problem did this in config_inc.php?

Code: Select all

	$t_protocol = 'https';
	$t_port = ':443';
	$t_path = '/bug';
	$g_path = $t_protocol . '://' . $t_host . $t_path.'/';
	$g_short_path = '/bug/';

Re: Redirect to https

Posted: 23 Mar 2011, 12:21
by fonnnnnn
i just change config in


config_inc.php and insert

$g_path = isset( $t_url ) ? $t_url : 'https://localhost/mantisbt/';

and it works ^^