CodeIgniter- CSS & JS are not loading when the site is run on localhost
<p>I am new to CodeIgniter and the MVC architecture but i know PHP very well. Here is the problem I am facing:</p>

<p>I downloaded the source code of the live website via cpanel (the site is developed on codeignitor) and now I am trying to modifying the site on Localhost.</p>

<p>I need to change the styling of the pages but I can't get the site to load it's CSS &amp; JS on localhost environment, only the html is being loaded.
I've checked various configurations and environment settings.
In config file I changed <code>$config['base_url']= "http://localhost/sitename/"</code> for localhost and other config variables are already set (since i downloaded the source code).</p>

<p>Now when i run the site on localhost with url <code>http://localhost/sitename/</code> , only the html is loaded without any styling, css/js nothing!</p>

<p>I also noticed the following : (thought it maybe useful)</p>

<p>in files like <code>header.php</code> and <code>footer.php</code> the CSS &amp; JS files are included like this <code>&lt;link href = "&lt;?php echo WEB_ROOT; ?&gt;/css/main.css" rel = "stylesheet" type = "text/css"/&gt;</code> and <code>&lt;script src="&lt;?php echo WEB_ROOT; ?&gt;/js/main.js"&gt;&lt;/script&gt;</code>.</p>

<p>Whereas in fact the css and js files are actually present in <code>root\assets\css\</code> and <code>root\assets\js\</code></p>

<p>So, </p>

<ol>
<li>How should I view the complete site (as it was online, with all the css &amp; js) on the localhost? Are there any settings or scripts that i need to change?</li>
<li>How was it actually working on the live website? (with wrong paths set for access to CSS &amp; JS)</li>
</ol>

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