Quote:
Originally Posted by mbaskett
The only thing I would like to change is the way images are displayed.... currently they pull from the filesystem (that's where we store our images), but they require the image folder to be accessible via http, which can allow direct linking to the images from outside.... I would like to be able to have it work with the images folder elsewhere, I just couldn't quite follow the GD code on how the image files were named, and how they were linked to the db records... as far as I can tell, it relies on the mysql insert order, and not a specific tag or identifier that can be linked in the db to a file (i.e. store the renamed image filename and thumb filename in a field in the db)
|
Easy fix for this is to simply use an .htaccess rule set in the image directory to prevent hotlinking. Something like this should do the trick:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]
With that in place, images will only be displayed if linked from your domain only. If you want to get nasty, you can have it display an alternate image to illegal link attempts with this (just replace the above RewriteRule line with the one below):
Code:
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/stophotlinking.gif [L,NC]