Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What is the best way to change to https using CodeIgniter 2.2?

Featured Replies

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.

  • 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 by Dredd2000

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.