Tired of having you images "hotlinked" by a competitor?
Want to play them a little trick while they steal your hard-work and your bandwidth?
Here a simple piece of code you can use to add a watermark to your images when they are requested from outside your domain.
-
Place the
hotlink.php
file in your web root and edit the few configs at the top of the file. -
Replace the
watermark.gif
image by your logo, or anything funny really. You can use a png or jpeg too. -
Edit the
.htaccess
file – your can merge with yours – to suit your needs.
Most of the image manipulation code is from Matt Wilcox's Adaptive-Image and repurposed for watermarking.
hotlink-watermark is released under the MIT License. See the bundled LICENSE file for details.