4
I would like to know how to insert an external css file into a Codeigniter 3 view. I set up the $autoload['helper'] = array('url'); I tried to make the call in the following ways:
<link rel="stylesheet" type="text/css" href="<?=site_url('application/views/css/main.css')?>">
<link rel="stylesheet" type="text/css" href="<?=site_url('css/main.css')?>">
I also tested using the base_url(); but the results were the same. It prints the html with the correct path but is not applying the styles. If I click this link inside the browser’s source viewer it redirects me to the default 404 codeigniter.
How is your apache’s folder structure? localhost points to your project or needs to enter one more directory level?
– gmsantos
Show how this folder structure of yours
– RFL
The problem was in my htaccess. was talking include the directory in the rule. Before: Rewritecond $1 ! (index.php|/css|js|images|robots.txt) After:Rewritecond $1 ! (index.php|includes/css|includes/js|includes/images|robots.txt)
– Rech