If it's just about one image, here's my Perl quick'n'dirty solution:
Quote:
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
use FindBin '$Bin';
# Config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
# chmod this file to 0666
our $LOG = $Bin . 'iplog.txt';
our $IMAGE_URL = 'http blabla com/image.jpg';
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
my $query = new CGI;
# Create log entry
open(my $fh, '>>', $LOG) or die "Cannot open $LOG for writing: $!";
print $fh $query->remote_host(), "\n";
close($fh) or die "Cannot close $LOG after writing: $!";
# Print redirection header
print $query->redirect($IMAGE_URL);
|
Save that file as /cgi-bin/my_image.pl, chmod it 755 and use mod_rewrite, e.g.
Quote:
RewriteEngine on
RewriteRule /some_dir/image.jpg /cgi-bin/my_image.pl
|
In your HTML file, simply use
Quote:
<img src="/some_dir/image.jpg" alt="Some slut" title="" />
|