Welcome Guest, Not a member yet? Register   Sign In
From Http to Https - Now browser gives ERR_CONTENT_DECODING_FAILED error in console
#2

(This post was last modified: 04-03-2016, 06:18 AM by Tpojka.)

I saw topic where you find such an advice
Have you at first tried solutions from this and this answers? 
Try those if you didn't (in order I posted those). 
Also for a while, there is sort of common functions used in custom created helper like in this page:

PHP Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if (!
function_exists('force_ssl'))
{
 
   function force_ssl()
 
   {
 
       $CI =& get_instance();
 
       $CI->config->config['base_url'] =
 
                str_replace('http://''https://',
 
                $CI->config->config['base_url']);
 
       if ($_SERVER['SERVER_PORT'] != 443)
 
       {
 
           redirect($CI->uri->uri_string());
 
       }
 
   }
}

function 
remove_ssl()
{
 
   $CI =& get_instance();
 
   $CI->config->config['base_url'] =
 
                 str_replace('https://''http://',
 
                 $CI->config->config['base_url']);
 
   if ($_SERVER['SERVER_PORT'] != 80)
 
   {
 
       redirect($CI->uri->uri_string());
 
   }
}
/* End of file ssl_helper.php */
/* Location: ./application/helpers/ssl_helper.php *//// 

PHP Code:
$autoload['helper'] = array('url''ssl'); 

Then, within `public function __construct()` of every controller requiring SSL, add the following:

PHP Code:
force_ssl(); 



But check first if you can solve it on server level.
Reply


Messages In This Thread
RE: From Http to Https - by Tpojka - 04-03-2016, 06:16 AM
RE: From Http to Https - by MasoodRehman - 04-03-2016, 09:40 AM
RE: From Http to Https - by MasoodRehman - 04-03-2016, 12:38 PM
RE: From Http to Https - by Tpojka - 04-03-2016, 12:59 PM
RE: From Http to Https - by MasoodRehman - 04-04-2016, 12:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB