Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:04:44+00:00 2026-06-15T05:04:44+00:00

I’m in the process of splitting resources across domains. I’ve read a few different

  • 0

I’m in the process of splitting resources across domains. I’ve read a few different ways on how to handle this. From what I’ve read the correct way to handle is to use absolute paths versus relative. If this is true, how would I handle this as I push my local development live? The domains won’t match from local to live.

The base_url allows for a single domain only as far as I’ve read. Should I create an asset path helper and autoload that? Or, is there something I’m missing here?

http://www.example.com would operate normally.
http://images.example.com/assets would point to my asset folder that exists in the root.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:04:45+00:00Added an answer on June 15, 2026 at 5:04 am

    After further research this is the way I solved my problem. Thanks to the Codeigniter forum for helping me get to this solution. Create a switch that checks which stage of development the site is in and set the base_url and asset_url config accordingly.

    switch(ENVIRONMENT)  //set in index.php
    {
      case 'development':
        $config['base_url'] = 'http://localhost/';
        $config['asset_url'] = 'http://localhost/assets/';
        break;
      case 'production':
        $config['base_url'] = 'http://yoursite.com/';
        $config['asset_url'] = 'http://assets.yoursite.com/';
        break;
    }
    

    Then just extend the url_helper and create a function to get the asset_url

    if ( ! function_exists('asset_url'))
    {
        function asset_url($uri = '')
        {
            $CI =& get_instance();
            return $CI->config->item('asset_url') . ltrim($path, '/');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is a good way to read this XML? Or maybe I can structure
Transaction (Process ID 63) was deadlocked on lock | communication buffer resources with another
//child process char buf[20]; read(fd[0][0], buf, 20); printf(%s, buf); //parent process write(fd[0][1], 12, 20);
Currently the my team is considering splitting our single CI build process into a
We are in the process of splitting our db into several smaller ones. The
I'm making a little file splitter-joiner, and I've already got the splitting process done.
My current Python project will require a lot of string splitting to process incoming
I'm looking to process this array of dates and an essentially boolean single value:
I'm trying to process a large gzip file pulled from the internet in python
I run across this problem frequently suppose I have a text file that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.