Welcome Guest, Not a member yet? Register   Sign In
Live site paths are not working but its working on dev site
#6

[eluser]InsiteFX[/eluser]
Place this at the end of - application/constants.php
Code:
/*
|--------------------------------------------------------------------------
| Document root folders
|--------------------------------------------------------------------------
|
| Author: Phil Sturgeon. [DO NOT REMOVE]!
|
| These constants use existing location information to work out web root,
| etc.
|
*/

// Base URL (keeps this crazy stuff out of the config.php
if (isset($_SERVER['HTTP_HOST']))
{
    $base_url  = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
    $base_url .= '://' . $_SERVER['HTTP_HOST'];
    $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);

    // Base URI (It's different to base URL!)
    $base_uri = parse_url($base_url, PHP_URL_PATH);

    if (substr($base_uri, 0, 1) != '/')  $base_uri  = '/' . $base_uri;
    if (substr($base_uri, -1, 1) != '/') $base_uri .= '/';
}

// Else It's localhost
else
{
    $base_url = 'http://localhost/';
    $base_uri = '/';
}

// Define these values to be used later on
define('BASE_URL', $base_url);
define('BASE_URI', $base_uri);

define('APPPATH_URI', BASE_URI . APPPATH);

// We dont need these variables any more
unset($base_uri, $base_url);

Place this in - application/config.php
Code:
$config['base_url'] = BASE_URL;

InsiteFX


Messages In This Thread
Live site paths are not working but its working on dev site - by El Forum - 09-11-2010, 06:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB