I have an install of codeigniter up, running and all is good. Except I want to now offer my users a means of uploading images. The only place I could think to put the folder was in the applications directory (aptly renamed to "app" in my case). Anyway. Since its an MVC I need to run rewrite conditions all over the place. And I believe this to be one of the scenarios.
What I need is to have a condition that works for this subfolder within the app folder
my original rewrite condition is
RewriteCond $1 !^(index\.php|static|robots\.txt)
which works great for those but not for this one case so I need a new condition that works with the above but supports app/upload (is this even possible)?
Life's a lot easier if you keep your assets outside of
application/
(as Robert mentioned).There are a ton of good asset management Sparks you can pick from to assist with this too - I authored one for my CI projects called sk-asset which provides a lot of view helpers & is structured:
... htaccess settings can simply bypass CI routing for existing files/dirs/etc:
The upload folder does not have to be in your application directory. In fact, it's better if it's not in it. This way you can separate the application from the content (uploads). You also don't need to rewrite the conditions if you do it this way. This is how my CI directory looks like: