CodeIgniter Forums
[SOLVED] CSS file 'Not Found' and not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [SOLVED] CSS file 'Not Found' and not working (/showthread.php?tid=43883)



[SOLVED] CSS file 'Not Found' and not working - El Forum - 07-26-2011

[eluser]Unknown[/eluser]
[SOLUTION]
Yeah I fixed it, I had to...

added the following to .htaccess
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

and changed...

Source code in "header_view.php" to:
Code:
<link href="/css/NiftyLayout.css" rel="stylesheet" type="text/css" />


because with the first way using "base_url" and opening the css file in chrome the url would be:
"home.currah.ca/index.php/home.currah.ca/css/NiftyLayout.css"

Now it seems to be working along with javascript to so that's nice.
[/SOLUTION]



Hey, All

New to the CI and the forums. I am having an issue with CSS not loading. No matter what I try I get a error(from the browser) loading my style-sheet. And no error appears in my Apache error log.

Everything is under the webroot...
PATH TO css: css/NiftyLayout.css
PATH TO views: application/views/header_view.php

Source code in "header_view.php":
Code:
<link href="<?= base_url(); ?>css/NiftyLayout.css" rel="stylesheet" type="text/css" />

View source from browser:
Code:
<link href="home.currah.ca/css/NiftyLayout.css" rel="stylesheet" type="text/css" />

Error when trying to view style-sheet source from browser:
Code:
NiftyLayout.css Failed to load resource: the server responded with a staus of 404 (Not Found)

.htaccess file could be stopping css views here it is...
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ /index.php/$1 [L]



[SOLVED] CSS file 'Not Found' and not working - El Forum - 07-26-2011

[eluser]John_Betong_002[/eluser]
I just tried your site using Google Chrome and it appears OK?

Did you fix it and not updated your post?