CodeIgniter Forums
Where do you keep your CSS, Image, JS, Flash etc etc files? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Where do you keep your CSS, Image, JS, Flash etc etc files? (/showthread.php?tid=6720)



Where do you keep your CSS, Image, JS, Flash etc etc files? - El Forum - 03-09-2008

[eluser]nikefido[/eluser]
I'm just going to make a new folder within the Application folder where the MVC folders are, but I was wondering if there is some sort of "best practice" for this with code igniter?


Where do you keep your CSS, Image, JS, Flash etc etc files? - El Forum - 03-09-2008

[eluser]dmiden[/eluser]
You can easily have them in your root directory ( above /system/ ) and then if you use the mod_rewrite you can modify it to exclude those dirs from the 'catch-all' regex.

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

Seperate each folder with a | if you want to exclude it.


Where do you keep your CSS, Image, JS, Flash etc etc files? - El Forum - 03-09-2008

[eluser]adamp1[/eluser]
I put them in a public folder and use my asset linker library to link to them.


Where do you keep your CSS, Image, JS, Flash etc etc files? - El Forum - 03-09-2008

[eluser]nikefido[/eluser]
I guess what I really need to know is from what file should I make my links relative to? I'd like to keep the links relative to make moving the app easier.

edit: thanks adam, i'll check it out!


Where do you keep your CSS, Image, JS, Flash etc etc files? - El Forum - 03-09-2008

[eluser]nikefido[/eluser]
Adam, I sent you a PM, but I can pretty much figure it out - however, while you include an "image" folder for where to put assets, your code doesn't look like it handles placing images in (yet?)

I was wondering if I'm wrong about this - how would you recommend handling images? Hard coding the HTML?