RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx RewriteCond %{QUERY_STRING} !^coral-no-serve RewriteRule ^/images/foo(.*)$ http://foo.bar.nyud.net:8090/images/foo$1 [R,L]