Take the 2-minute tour ×

I have followed a couple of tutorials for adding rules in ISAPI to stop image hotlinking for a website I own.

I have added this

RewriteCond Referer: (?!http://(?:www\.mydomain\.co\.uk)).+
RewriteRule .*\.(?:gif|jpg|png) /images/block.gif [I,O]

BUT all the images are changed on the actual site to block.gif? No matter what I try it just replaces all the images and not just changing the image for people hotlinking? Any ideas what is wrong with my syntax?

share|improve this question
add comment

1 Answer

First, please specify the version of ISAPI_Rewrite you are using - is it 2 or 3? Then could you please specify more explicitly what was it you tried: "No matter what I try..." And finally, try to fix the cond like this:

RewriteCond Referer: (?!.*mydomain\.co\.uk).+
share|improve this answer
add comment

Your Answer


