Welcome Guest, Not a member yet? Register   Sign In
Can't access /css/style.css
#1

[eluser]a_bains[/eluser]
Hello,

My directory structure is as follows:

/
.htaccess
system/
..application/
..controllers/
..css/
...style.css

The style.css is in /system/css/style.css

When I try the url http://192.168.0.6/css/style.css it says page cannot be found. I have removed the index.php file from the url. When I try http://192.168.0.6/system/css/style.css then it works..
#2

[eluser]danmontgomery[/eluser]
/system/css/style.css and /css/style.css are different paths...
#3

[eluser]a_bains[/eluser]
Yes I understand, sorry, I prefer to use the first url ie. http://192.168.0.6/css/style.css without having to remember to include the system directory in all my URLs.

I just hardcoded system into my CSS URL and that works - is using system in URLs (images, CSS, scripts, etc) common practice for CI developers?

Code:
<link rel="stylesheet" type="text/css" href="/system/css/style.css" />
#4

[eluser]xzela[/eluser]
I found a really nice helper called Snappy Source which helps you add images, scripts, and styles to your views.

More information can be found here
http://codeigniter.com/wiki/Snappy_Source/

I highly recommend it.
#5

[eluser]a_bains[/eluser]
Awesome thanks - good to know!




Theme © iAndrew 2016 - Forum software by © MyBB