CodeIgniter Forums
htaccess and static files - 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: htaccess and static files (/showthread.php?tid=53178)



htaccess and static files - El Forum - 07-13-2012

[eluser]cinoob[/eluser]
I have the following directory structure:

/appname
application
css
images
js
system

and this is my .htaccess file:

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


I have no problem loading pages but no images are loading. I'm getting 404 errors for all contents in the images directory. No problems loading css or js files either.

Anyone got any ideas on why this may be?


htaccess and static files - El Forum - 07-13-2012

[eluser]CroNiX[/eluser]
What do the img srcs look like in the html compared to the css/js?
Does your images dir have the same permissions and owner/group as the others?


htaccess and static files - El Forum - 07-13-2012

[eluser]cinoob[/eluser]
Resolved although I'm not too sure how. It was probably a permissions issue that caused it. I moved the images into a temp folder, deleted the images folder, recreated it and moved the images back in. All working now.


htaccess and static files - El Forum - 07-13-2012

[eluser]Aken[/eluser]
Is that .htaccess file in your appname subfolder? Because it shouldn't work if it's in the root. Just curious.


htaccess and static files - El Forum - 07-14-2012

[eluser]cinoob[/eluser]
Hi Aken, yes it was in the appname folder.

Thanks