I need to write a rule to redirect any image file to a specific folder. Namely ‘images’
RewriteCond $1 ^(.*\.jpg|.*\.gif|.*\.bmp)
That will match all the imag, the the rerwrite part is confusing me. I want that
Http://domain.com/path/controller/view/image.jpg http://domain.com/any/path/that/i/want/image.jpg
to load the file
http://domain.com/iamges/image.jpg
Is this possible?
The R option in the [L,R] is forcing a visible rewrite – if you want it to appear that the image is coming from the request url then just use [L]
Take a look at the mod_rewrite documentation for more details