Forum Moderators: phranque
1) If you have access to httpd.conf, use the CustomLog [httpd.apache.org] and SetEnvIf directives to log those requests to /dev/null
2) Use mod_rewrite to rewrite those requests to a special 'hotlinker' image file (put your logo and URL on it)
Jim
mod_rewrite seems to trig with the following condition:
RewriteCond /your/docroot/%{REQUEST_FILENAME}!-f
But the Apache manual warn about this beeing slow and I've got alot of requests. I would prefer conditional loging.
SetEnvIf Request-URI ^removed_file_1.gif removed
SetEnvIf Request-URI ^removed_file_2.jpg removed
#
CustomLog /dev/null common env=removed
<DirectoryMatch ^/path_to_image_directory$>
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(gif¦jpe?g)$ - [E=removed:1,L]
</DirectoryMatch>
#
CustomLog /dev/null common env=removed
Also, I can't remember if the var in the RewriteRule needs to be set to '1', or 'True', or just set to any non-blank value.
I haven't tested this code. You may need to tweak it a bit.
Change all broken pipe "¦" characters to solid pipes before trying to use this code; Posting on this board modifies them.
Jim