Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member lew1s's Avatar
    Join Date
    Oct 2013
    Posts
    65
    Member #
    37371
    Liked
    2 times

    change root path

    Hi,

    I am using codeigniter on one old site. I change the root folder from

    www.website.com to www.website.com/old-site

    All stylesheets and files and images are pointing still to the www.website.com.

    can you please help what to change?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    I don't have an 'exact' answer for you, but look at some of these examples using .htaccess:
    https://www.google.com/#q=htaccess+c...root+directory

    I think there might be some things that will give you some ideas, or things to try.

    I'm not such an expert at .htaccess


  4. #3
    Member lew1s's Avatar
    Join Date
    Oct 2013
    Posts
    65
    Member #
    37371
    Liked
    2 times
    So this is my index.php file . everything is set up to root folder. which was capitalproperties.ie. now i moved the files to subdomain directory.capitalproperties.ie but dont know how to change the server path . working in wordpress , so i am confused from codeigniter.

    1. what change in index.php to load path directory.capitalproperties.ie
    2. or i have to create .htaaccess file for redirecting ?

    <?php
    /*
    |---------------------------------------------------------------
    | PHP ERROR REPORTING LEVEL
    |---------------------------------------------------------------
    |
    | By default CI runs with error reporting set to ALL. For security
    | reasons you are encouraged to change this when your site goes live.
    | For more info visit: PHP: Runtime Configuration - Manual
    |
    */
    error_reporting(E_ALL);

    /*
    |---------------------------------------------------------------
    | SYSTEM FOLDER NAME
    |---------------------------------------------------------------
    |
    | This variable must contain the name of your "system" folder.
    | Include the path if the folder is not in the same directory
    | as this file.
    |
    | NO TRAILING SLASH!
    |
    */
    $system_folder = "system";

    /*
    |---------------------------------------------------------------
    | APPLICATION FOLDER NAME
    |---------------------------------------------------------------
    |
    | If you want this front controller to use a different "application"
    | folder then the default one you can set its name here. The folder
    | can also be renamed or relocated anywhere on your server.
    | For more info please see the user guide:
    | http://codeigniter.com/user_guide/ge...ging_apps.html
    |
    |
    | NO TRAILING SLASH!
    |
    */
    $application_folder = "application";

    /*
    |================================================= ==============
    | END OF USER CONFIGURABLE SETTINGS
    |================================================= ==============
    */


    /*
    |---------------------------------------------------------------
    | SET THE SERVER PATH
    |---------------------------------------------------------------
    |
    | Let's attempt to determine the full-server path to the "system"
    | folder in order to reduce the possibility of path problems.
    | Note: We only attempt this if the user hasn't specified a
    | full server path.
    |
    */
    if (strpos($system_folder, ‘/’) === FALSE)
    {
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
    {
    $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    }
    }
    else
    {
    // Swap directory separators to Unix style for consistency
    $system_folder = str_replace("\\", "/", $system_folder);
    }

    /*
    |---------------------------------------------------------------
    | DEFINE APPLICATION CONSTANTS
    |---------------------------------------------------------------
    |
    | EXT - The file extension. Typically ".php"
    | SELF - The name of THIS file (typically "index.php")
    | FCPATH - The full server path to THIS file
    | BASEPATH - The full server path to the "system" folder
    | APPPATH - The full server path to the "application" folder
    |
    */
    define('EXT', '.php');
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
    define('FCPATH', str_replace(SELF, '', __FILE__));
    define('BASEPATH', $system_folder.'/');

    if (is_dir($application_folder))
    {
    define('APPPATH', $application_folder.'/');
    }
    else
    {
    if ($application_folder == '')
    {
    $application_folder = 'application';
    }

    define('APPPATH', BASEPATH.$application_folder.'/');
    }

    /*
    |---------------------------------------------------------------
    | LOAD THE FRONT CONTROLLER
    |---------------------------------------------------------------
    |
    | And away we go...
    |
    */
    require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

    /* End of file index.php */
    /* Location: ./index.php */

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    Can you copy and paste your ".htaccess" file here?

    I'm sure that's where the change will need to be.

    Note that you have added a "subdomain", not a "subdirectory" ... two totally different things.


  6. #5
    Member lew1s's Avatar
    Join Date
    Oct 2013
    Posts
    65
    Member #
    37371
    Liked
    2 times
    i changed the application/config/config.php , see the configuration option ‘base_url’. and now the iste is fine . but when i click on any link i am still on the same home page . i dont have .htaccess at all in my root folder.
    can you please help .

    this site Property for sale in Dublin - Property for rent in Dublin | Capital Properties


    Quote Originally Posted by mlseim View Post
    Can you copy and paste your ".htaccess" file here?

    I'm sure that's where the change will need to be.

    Note that you have added a "subdomain", not a "subdirectory" ... two totally different things.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com