October 16, 20179 yr Hello all, I've upgraded my site to https using this snippet of code in my config.php file, (CodeIgniter 2.2). $root=(isset($_SERVER['HTTPS']) ? "https://" :"http://".$_SERVER['HTTP_HOST']); $root.= str_replace(basename($_SERVER['SCRIPT_NAME']),'',$_SERVER['SCRIPT_NAME']); $config['base_url'] = $root; The code works fine, however, I had to delete all of my base_url() and site_url() functions and change them to a simple backslash. It's a large site so it took my a while to do. Does anyone know if there's a way to change your site to https without having an effect on your sit_url and base_url functions? Thanks in advance.
October 16, 20179 yr Author Sorry guys! Can't see the wood for the trees! Simply change the line in the config.php file to: $config['base_url'] = 'https://yourdomain.com/'; After getting the new SSL certificate! Edited October 16, 20179 yr by Dredd2000
Create an account or sign in to comment