Hey all recently I stumbled across another website that was stealing one of our own created images and to add insult to injury the offending site is just hotlinking it. Obviously this is against the law since we own the rights to this image. But instead of sending off an email and barking to the site owner about removing it I decided to try using the rewrite engine via the .htaccess file and since the image is a hotlink I want to replace the requested image with an advertising image to my site, it bring me joy for some reason to think of this working. So I stumbled around the Internet and came up with this code. RewriteEngine on RewriteCond %{HTTP_REFERER} ^http://offendingDomain.com/ [NC] RewriteRule \.(gif|jpg)$ http://www.mydomain.com/_img/substituteImage.jpg [R,L] Now when I visit the site in question, it blocks the requested image, but does not show the substitute image. Can someone spot a syntax error in my code, or am I way off? Thanks,
I have tried so many different combinations of this code. I am starting to wonder if it's not my code and maybe a setting on my server.
I still could not get this thing to work, it has to be an improper syntax or maybe it's something not correct with the RewriteEngine.
I have tried every single version of the code listed on this forum and other sites, all with the exact same results. All that is shown on the offending site is a empty image place holder, it does not replace the image with the one I want it to. I can not figure this out, has anyone who actually posted these codes got it to actually work? Here is my current version of the .htaccess code. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} \.(gif|jpg|png|swf|css|tpl|ico|mp3)$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?aidmymeniscus.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://aidmymeniscus.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(images\.)?google.*/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://([^.]+\.search\.)*msn.*/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://([^.]+\.search\.)*live.*/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://([^.]+\.search\.)*yahoo.*/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(images\.)?ask.*/.*$ [NC] RewriteCond %{HTTP_REFERER}---%{HTTP_HOST} !^http://([^/]+)/.*---\1$ [NC] RewriteRule (.*) http://www.aidmymeniscus.com/_img/meniscus_info.jpg [R,NC,L] </IfModule>
just rename the advertisement u want as the original file name. , so on his site ur advertisement will show up .
you must allow the image you want to appear on rivals's site, so you must unblock it from appearing with the line of code RewriteCond %{REQUEST_URI} !hotlink.gif$ Code (markup): So the full .htaccess would be RewriteEngine on RewriteCond %{REQUEST_URI} !hotlink.gif$ RewriteCond %{HTTP_REFERER} !^http://firstsite.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.firstsite.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.mysite.com/hotlink.gif [R,L,NC] Code (markup):