Hotlink protection: securing PHP-generated images

Kelmas

Well-Known Member
Nov 6, 2006
121
0
166
Lithuania
I used cPanel's hotlink protection, which uses mod_rewrite rules, but it protects only static images, like file.jpg, mypicture.gif etc.

On my system I have a PHP script that generates image, so URL to it is something like image.php?photo=123 where 123 is unique image number. How do I build a rewrite rule to protect this type of image?

Tried diffrent ways but no luck :confused:
 

pross

Well-Known Member
Mar 14, 2005
75
0
156
surely u could add a line to check that $_SERVER['HTTP_REFERER'] is your server if not deny the image