0

I made a asset folder and in it a css folder. For accessing css files I do this:

<link href="<?php base_url()?>assets/css/css.css" rel="stylesheet" type="text/css" />

Which works 100% fine as long as the url is:

http://localhost/web/

But when i change the URL to

http://localhost/web/index.php Or

http://localhost/web/index.php/welcome/

It stops loading css or images. It must be noted that css is in the assets folder whose location is: localhost/web/assets/ where as images are in the view folder along with the php files.

My .htaccess file looks like this

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

plus my .htaccess file is in the application folder

Kumar V
  • 8,810
  • 9
  • 39
  • 58
Rana Tallal
  • 424
  • 7
  • 15
  • What base_url do you have set in your config.php? If you look at the page with a tool such as Firebug what URL is it trying to load the CSS file from? – Dazz Knowles Jan 19 '14 at 14:34

1 Answers1

1

Try adding a rewrite condition to exclude the images and assets directories:

RewriteCond %{REQUEST_URI} !(images|assets) [NC]
Youn Elan
  • 2,379
  • 3
  • 23
  • 32