Mod_Rewrite plugin - How do I replace a hotlinked image with a custom image?

evilc

Joined: 2004-08-01
Posts: 47
Posted: Tue, 2011-05-24 23:06

When people hotlink an image, instead of just leaving it blank, I want to serve a different image - ie one that says "I eat babies" or something similarly abusive ;)

At the moment, I acheive this by setting url rewrite to "Send HTML for hotlinked items", then editing the .htaccess file thus:

Replace
RewriteRule . /gallery2/main.php?g2_view=rewrite.DownloadItem&g2_itemId=%1 [L]
with
RewriteRule . /gallery2/antihotlink.jpg [L]

Can anyone tell me if there is a way to do this using the GUI? Does anyone know how to go about modding the rewrite plugin to add an option for redirecting to an alternate image?