Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter: unable to link the referencing css file

I am just starting out with Codeigniter. I have referenced the css file in the corresponding views file but it fails to link. This is the code I have used to reference the css file.

<link rel="stylesheet" href="<?php echo base_url();?>css/style.css" type="text/css" media="screen"/>

I tested the css code by inserting it between & and it works. Just can't get the linking to work.

like image 329
strangeloops Avatar asked Feb 06 '10 12:02

strangeloops


1 Answers

I'm sorry, rewriting the whole answer as I remember what I had to do and which should fix your problem.

Check your .htaccess file in the top level directory, I added exceptions for js/css/images dirs otherwise they would have been rewritten:

RewriteEngine on
RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
like image 87
Matteo Riva Avatar answered Sep 30 '22 07:09

Matteo Riva