Skip to content
Advertisement

CodeIgniter not loading CSS and JS while migrating website from one domain to another domain and hosting

While migrating the website. I’m not able to load CSS and JS files in my Codeigniter project.

FOLDER STRUCTURE:

JavaScript

config.php < config < application < public_html

JavaScript

header.php < layout < front < views < application < public_html

JavaScript

Help. Thanks! (Do let me know if I need to furnish more details)

EDIT: view-source:http : / / domain.com/ (Please ignore spaces in between http.)

JavaScript

EDIT: Added constants.php

constants.php < config < application < public_html

JavaScript

Advertisement

Answer

Your base_url is defined as

JavaScript

You will need to load the url helper in your controller or you can autoload it, then you can utilise the function base_url().

Then you have a choice of either using

JavaScript

OR you can assign FRONT_MEDIA_URL

JavaScript

BUT you will need to have loaded the url helper prior and you’ve not shown where you have declared that, but that is for you to figure out.

UPDATE due to new information See if you can use this Now I do not know where you are defining sSITE_MODE but this is an option to help with the use of base_url() in your site…

In application/config/config.php you could do something like

JavaScript

OR just define the correct Constant and use it. You have FRONT_MEDIA_URL in your links and then you are talking about using URL. You need to use the correct one.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement