• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
404 error in CSS file

I've been following the tutorials at nettuts for CI, and I've had no issues so far. I'm running XAMPP on windows 7. I have CI installed at C:\xampp\htdocs

As per the tutorial, in the root CI folder, I have a folder called css, that contains style.css.

In the header of a specific view, I've called the following:
<link rel="stylesheet" href="<?php echo base_url();?>css/style.css" type="text/css" media="screen" charset="utf-8">

The CSS file itself however, returns a 404. Everything else is fine. The view loads fine. All controllers load fine.

My config.php file is set with
$config['base_url']    = "http://localhost/";

I'm not sure what I've done incorrectly here. I know I'm probably just missing one small detail. Any suggestions?

Fixed by commenting out everything in my .htaccess file. Now I need to figure out what was going on in there that caused this.

Try this one. works for me and my assets subdirectories in the root dir

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


[eluser]Dan Horrigan[/eluser]
vitoco's solution will work. The cause of your issue is that your .htaccess file is trying to route to a controller named "css" (which obviously doesn't exist. The .htaccess code in the above post tells it only to route it to the bootstrap file if the target is not a real director or file.

Just thought I would shed some light so you have a better understanding.


Ah yes that worked. Big Grin

Thank you guys!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.