Welcome Guest, Not a member yet? Register   Sign In
404 error in CSS file
#1

[eluser]kaos78414[/eluser]
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:
Code:
<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
Code:
$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?
#2

[eluser]kaos78414[/eluser]
Fixed by commenting out everything in my .htaccess file. Now I need to figure out what was going on in there that caused this.
#3

[eluser]vitoco[/eluser]
Try this one. works for me and my assets subdirectories in the root dir

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

Saludos
#4

[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.

Dan
#5

[eluser]kaos78414[/eluser]
Ah yes that worked. Big Grin

Thank you guys!




Theme © iAndrew 2016 - Forum software by © MyBB