Utilizing a .htaccess rewrite rule, I have to add "?q=" prior to the path on any URL's that contains the term "imagecache"

Therefore, when the URL is:


...it will truly try:


But which will ONLY happen when the URL consists of "imagecache." Otherwise, it will no spinning.

Also, this can only happen if /sites/default/files/imagecache/myimage.digital is not already a current image file. In my opinion I'm able to do this using:

RewriteCond %{REQUEST_FILENAME} !-f

...right? It is simply part one which i can't determine.

Something similar to this?:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*imagecache.*)$ /?q=$1 [L,QSA]
RewriteRule ^mysite.com/(.*)/imagecache/(.*)$ mysite.com/?q=$1/imagecache/$2