Can’t include js css files in Codeigniter [Solved]

If you cannot include any js or css file in your pages in codeigniter and you’ve tried all of the solutions available online then the following solution may help you out:

Are you using a .htaccess file? If yes then you need to modify it so that it excludes requests for css and js folders.

Have a look at my .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|js|css|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

I am using the js and css folders for the javascript and css files respectively.

Hope that helped 🙂

Any questions? Don’t hesitate to comment below…

2 Responses

Leave a Reply