Welcome Guest, Not a member yet? Register   Sign In
How to link external css files in codeigniter 2.0
#11

[eluser]mi6crazyheart[/eluser]
@phil Sturgeon
I was also thinking about the same thing. Thx Phil. Your reply make our doubts clear...
#12

[eluser]haydenk[/eluser]
[quote author="Phil Sturgeon" date="1280073303"]They moved application folder outside of system folder in 2.0 a while ago and added some .htaccess rules to restrict that sort of thing.

There is no reason to add your assets in the view folder, put them in the root.[/quote]

I see now about the moving the application folder out of system, that's cool. That was actually an optional "feature" you could/can do in 1.7.2 and I started doing because I rather liked it. I will have to play with more later tonight.

I will have to play with the htaccess. I started using the new one on 1.7.2 and haven't had a problem accessing assets.
#13

[eluser]wortell[/eluser]
for anyone else wondering...

orig. .htaccess setup for my CI 2.0 app

Code:
...
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
...

and now...

Code:
...
RewriteCond $1 !^(index\.php|images|application|scripts|styles|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
...

fixed that 403/404 issues... with directly accessing (or by style/script accesses in <head> section of html page)
#14

[eluser]Unknown[/eluser]
I encountered the same problem. all that was needed is a mod to the .htaccess file
be sure to include the following

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

it will also remove the required index.php from the url
#15

[eluser]why.you.and.i[/eluser]
Hello, i'm having the same problem here, including CSS works only if the CSS is put on the root folder but fail when i put it in application/media folder (i'm using CI 2.0.2 too).

Sadly, the mod-rewrite suggested before doesn't work for me, it keeps redirecting me to the xampp homepage. I'm using this for now in my root htaccess, can anybody help me with the htaccess (so i can put my css in application folder)?


My htaccess now (in root folder)
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
#16

[eluser]KarlBallard[/eluser]
Use the HTML tag - <base>
#17

[eluser]InsiteFX[/eluser]
Because there is a .htaccess file in the application folder that stops access to it!

Create an assets folder in your root folder with index.php

InsiteFX
#18

[eluser]why.you.and.i[/eluser]
The <base> tag didn't make a difference to me Sad

I gave up and put the assets folder in my root and it works now. Thank you Smile




Theme © iAndrew 2016 - Forum software by © MyBB