First:
You should post all your url rewrite configuration you have.
Second:
Always check documentation for examples, i dont see what have you tried.
url rewrite version 4.0
url rewrite version 3.0
Three:
Know what version your working on.
Finally:
Here is Solution i did and its working nice.
The portion i have to modify in my case is adding the both lines
in three places yes three. why keep reading ))
<set type="response-header" name="Cache-Control">max-age=290304000</set>
<set type="expires" name="expires">24 hours</set>
......
<rule>
<from>/images/((?:(?!/).)*)/(.*)$</from>
<to encode="true" last="true" qsappend = "true">/files/get.html?file=$2&preset=$1</to>
<set type="response-header" name="Cache-Control">max-age=290304000</set>
<set type="expires" name="expires">24 hours</set>
</rule>
<outbound-rule>
<from>/images/(.*)/(.*).(jpg|png|jpeg|gif).html</from>
<to>/images/$1/$2.$3</to>
<set type="response-header" name="Cache-Control">max-age=290304000</set>
<set type="expires" name="expires">24 hours</set>
</outbound-rule>
<rule>
<from>/files/original/(.*)$</from>
<to encode="true" last="true" qsappend = "true">/files/get.html?file=$1</to>
<set type="response-header" name="Cache-Control">max-age=290304000</set>
<set type="expires" name="expires">24 hours</set>
</rule>
Reason:
Depending on your settings for your project there is rules
and there is out bound and other stuff ; they might re write
the url several times according to your rules complexity and logic
so in my case tried to do it with minimum addition but, it did not
work only when i add it to the three places ( without showing all my rules but you got the idea :) )
And i did this as well its Better Approach as well
Using APACHE configuration