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

1
  • 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? Commented Jan 19, 2014 at 14:34

1 Answer 1

1

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

RewriteCond %{REQUEST_URI} !(images|assets) [NC]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.