Redirect to https

Post about your customizations to share with others.

Moderators: Developer, Contributor

Redirect to https

Postby t3knoid » Apr 30, 2009 4:53 pm

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 );
}
t3knoid
 
Posts: 4
Joined: Apr 30, 2009 4:44 pm

Re: Redirect to https

Postby Kirill » Jul 29, 2009 9:49 am

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/';
Kirill
 
Posts: 434
Joined: Nov 25, 2007 3:05 am
Location: Kaliningrad, RF

Re: Redirect to https

Postby fonnnnnn » Mar 23, 2011 7:21 am

i just change config in


config_inc.php and insert

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

and it works ^^
fonnnnnn
 
Posts: 13
Joined: Mar 11, 2011 5:27 am


Return to Customizations

Who is online

Users browsing this forum: No registered users and 2 guests

cron