Skip to content

Instantly share code, notes, and snippets.

@mrskl21
Last active September 2, 2021 12:04
Show Gist options
  • Save mrskl21/31c85177114aabf039eac81ab8c5329f to your computer and use it in GitHub Desktop.
Save mrskl21/31c85177114aabf039eac81ab8c5329f to your computer and use it in GitHub Desktop.
<?php
$base_url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$base_url .= "://". @$_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
$config['base_url'] = $base_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment