change .htaccess to not pass .js/.css/.jpg requests through to index.php

Posted by Dean on Server Fault See other posts from Server Fault or by Dean
Published on 2010-04-23T02:41:12Z Indexed on 2010/04/23 2:43 UTC
Read the original article Hit count: 246

Filed under:
|

Hey guys, bit of a mod_rewrite noob, I've got:

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1

Which I believe says "If the file or directory exists, don't pass it to index.php". I'd like another line which says "If it's a .jpg, .css, .js - don't pass it to index.php". Any help appreciated.

Thanks :)

© Server Fault or respective owner

Related posts about .htaccess

Related posts about mod-rewrite